On Monday, 18 January 2016 at 01:38:16 UTC, Andrei Alexandrescu wrote:
On 1/17/16 8:07 PM, deadalnix wrote:
A common way to do it is to go quicksort, but only recurse on one side
of the set. That should give log(n)^2 complexity on average.

Yah, that's quickselect (which this work started from). It's linear, and you can't get top n in sublinear time because you need to look at all elements. -- Andrei

Yeah; forget about me, I was dumb on that one.

Reply via email to