On Monday, 23 June 2014 at 22:47:20 UTC, Xinok wrote:
What do you all think? Do you agree with my definition of stable topN? Do you know of a better algorithm/approach for implementing this function?
I agree with your definition, and can't think of a better algorithm, but wouldn't a stable sort have the same effect as your algorithm? Both are O(n lg(n)) time and O(n) space.
