First create Radix Tree(or just trie) and count occurrences of each word, create a Min Heap of size 10, then scan the radix tree
Read full article from java - Returning 10 most frequently used words in a document in O(n) - Stack Overflow
Read full article from java - Returning 10 most frequently used words in a document in O(n) - Stack Overflow
No comments:
Post a Comment