2 ms·
You can use the same idea in quicksort while choosing the pivot (and make it O(n log n)) but you don't because it is expensive. There is a very nice and simple
by myle 13y ago
You can use the same idea in quicksort while choosing the pivot (and make it O(n log n)) but you don't because it is expensive.
There is a very nice and simple probabilistic algorithm instead.