Heap Sort has a worst case complexity of O(nlogn) while Quicksort has O(n^2). But emperical evidences say quicksort is superior. Why is that?
O(nlogn)
O(n^2)
Here's a couple explanations:
http://www.cs.auckland.ac.nz/software/AlgAnim/qsort3.html
http://users.aims.ac.za/~mackay/sorting/sorting.html
Essentially, even though the worst case for quick sort is O(n^2) it on average will perform better. :-)