Question: Write a java program that reads a file (input.txt) and produces a histogram of the most frequently used words (all in lower case) found in
Write a java program that reads a file (input.txt) and produces a histogram of the most frequently used words (all in lower case) found in the text. Ignore capitalization, whitespace, and punctuation. Sort the output in order of increasing usage of words. Words with same frequency can appear in any order.

You need to develop 3classes: 1-Class Node with two instance variables to record a word and the frequency of that. Class Node implements Comparable Node Node String word Int freq 2- Class Algorithm with two methods 2-1)Method sort: which gets a Vector of Nodes as its parameter and it returns the sorted 2-2) Method printVector: which gets a Vector of Nodes as its parameter and it prints the vector based on the above format (Sample Output) Algorithm static.... Sort( Static print Vector( 3- Class Test, Which reads the input file and creates a vector of Nodes (for the words in the file), and sorts and prints the result using methods in class Algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
