Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Quicksort isn’t stable.


Schoolbook exchange quicksort isn't stable, but quicksort absolutely can be implemented stably, which I do in glidesort: https://www.youtube.com/watch?v=2y3IK1l6PI4.


Further to that, many use cases of Quicksort have unique keys, so stable is the same as unstable. Example: ascending indices appended to the key, when sorting large records where we don't want to move around the entire record.




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

Search: