2 ms·
Quicksort's worst case involves bad pivot picking. The randomized version pretty much makes that a non-issue unless you're incredibly unlucky. Even still, with
by aston 19y ago
Quicksort's worst case involves bad pivot picking. The randomized version pretty much makes that a non-issue unless you're incredibly unlucky. Even still, with median-of-medians you can guarantee a deterministic worst case of nlog(n), so that's not true.