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

Now build me a selection algorithm out of mergesort.

Just the other day I sped up a process by an order of magnitude because someone was sorting to do weighted median selection. Which is easy to build on top of std::nth_element. Top-k is another common need.

Quicksort is still worthy today also because of this.



Or you could just have people study QuickSelect and gain the same benefit without wasting on a slower sorting method when taking into account cache etc.




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

Search: