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

来源:互联网 发布:40本网络禁书本地下载 编辑:程序博客网 时间:2024/04/29 12:19

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.

0 0
原创粉丝点击