3 ms·
Generally it is preferable to choose the pivot randomly.
by kccqzy 7y ago
Generally it is preferable to choose the pivot randomly.
- hhmc 7y agoSure, and the wikipedia page makes mention of that. But it's not super relevant to the point I'm making about the worst-case complexity of quick sort (which is often misunderstood to be O(n^2)).