News for hackers. Stuff that matters.
Re:How I Got a 2x Speedup With One Line of Code by nly on Thursday November 14, 2013 @09:12PM (#6737259)
Yes, this is exactly what the author is trying to port to Python.

Mandatory reference link: http://en.cppreference.com/w/cpp/algorithm/nth_element . Note linear complexity.

There's also std::partial_sort:

http://en.cppreference.com/w/cpp/algorithm/partial_sort

There are no comments on this comment yet.