Preview

We can use this insight to adapt quicksort so that it has no particular worst-case input.

We will pick our pivot randomly.

Sometimes this will lead to a bad split, and sometimes to a good split, but no one can force a bad split.

This will lead to an algorithm with expected running time of tex2html_wrap_inline256 .


next up previous
Next: PROBABILITY THEORY Up: PROBLEM WITH QUICKSORT Previous: Importance of Being Random