Thanks to visit codestin.com
Credit goes to www.blogger.com

Blogger

Delete comment from: Stevey's Blog Rants

@mlvanbie

Sure, you can tweak the selection algorithm and guarantee an n log(n) runtime, but you kill your performance, so nobody does it that in practice. That's why the textbook answer is that quicksort is n log(n) in the average case, and n^2 in the worst, but everyone picks it over mergesort because its constants are so much lower in the average case.

Special pivot selection is more of theoretical interest -- though I agree it is interesting and worth being aware of.

Mar 15, 2008, 6:12:00 AM


Posted to Get that job at Google

Google apps
Main menu