Comment Comment by dzorz The original article uses heap to get top K numbers. It's runtime complexity is O(N*log(K)) and nth_element is O(N), so the algorithms are not similar at all. parent dzorz 15 years ago