4 ms·
At the risk of being pedantic: quicksort has a worst-case runtime of O(n^2).
by ckuehne 16y ago
At the risk of being pedantic: quicksort has a worst-case runtime of O(n^2).
- dgordon 16y agoAt the risk of being even more pedantic, quicksort with the O(n) deterministic median finding algorithm has a worst-case runtime of O(n log n) -- you use that algorithm to find the median each time and use that as the pivot. The constants would make it less efficient for most cases, though.