Hacker News new | past | comments | ask | show | jobs | submit login

quicksort is O(nlogn) average case, and O(n2) on already sorted arrays.



Just a nitpick: There are versions of quicksort that perform well, O(n*log n), on already sorted data. But there is always some worst case scenario where it can be O(n^2).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: