[LinkedIn] Find the 100 most frequently occurring words in a set of documents.

CareerCup 看到的解答:
1. Get count of each word.
2. Create a MIN heap of word counts with 1st 100 elements.
3. Now for all other word counts , if count is smaller (OR equal) than root (of max heap), ignore it, otherwise replace the root with new greater count and heapify.

posted on 2015-03-30 23:37  Seth_L  阅读(142)  评论(0编辑  收藏  举报