3 ms·
> It seems to me that if you know the K'th largest, it's O(N); but otherwise, it's harder. Finding the kth largest element can be done in O(N) time. http://en
by radq 15y ago
> It seems to me that if you know the K'th largest, it's O(N); but otherwise, it's harder.
Finding the kth largest element can be done in O(N) time.
http://en.wikipedia.org/wiki/Selection_algorithm http://en.wikipedia.org/wiki/Selection_algorithm