News for hackers. Stuff that matters.
Re:LINQ Ruined My Favorite Interview Question by klipt on Thursday July 11, 2013 @04:39PM (#6029067)
> collections.Counter.most_common() uses heapq.nlargest() which is slightly more efficient than a full n*log n sort.

Creating a heap is O(n) if I remember correctly, so that may well be the most efficient solution.

There are no comments on this comment yet.