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**

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 28SA
icon
Related questions
Question

(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 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**



Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning