Bubble sort existing doesn't mean that sorting is O(n^2)
(and I mean, your example is P with respect to problem space - but wrt to the number of binary digits it's O(2^(0.5*n)) )
Bubble sort existing doesn't mean that sorting is O(n^2)
(and I mean, your example is P with respect to problem space - but wrt to the number of binary digits it's O(2^(0.5*n)) )