Suppose we have a document of D distinct words and we want to return the N most frequently occuring words in the document. Assume N is much less than D. Describe the fastest algorithm (clearly list each step of the algorithm) to solve this problem, starting with a hash table in which to store the frequencies. You may use additional structures, as long as they are one of the structures covered in class. Make sure to specify what is the key and what is the value for all structures used. Against each step of your algorithm, write down the big 0 running time with an explanation of how you got it, and specify whether this running time is expected time or worst case time. You can use known-from-class structures you use, **but you still have to write what the actual running time is**
(Give in java)
Suppose we have a document of D distinct words and we want to return the N most frequently occuring words in the document. Assume N is much less than D.
Describe the fastest
Against each step of your algorithm, write down the big 0 running time with an explanation of how you got it, and specify whether this running time is expected time or worst case time. You can use known-from-class structures you use, **but you still have to write what the actual running time is**
Step by step
Solved in 3 steps with 1 images