Originally Posted by
Norm
When describing the steps the program should take, use common words to describe a value, not a program variable name. What values does "n" hold? The frequency count of the current word? The number of files read?
The variable "n" has been replaced by "k".
k is used for storing an number which says the top occurring words i mean if hello:4,hi:3,norm:1 and the user enters 2 for "k" then hello:4,hi:3 is only displayed based on only the count of the words.
Since the arraylist contains all the words from all the files, what will the counting code do about repeated words?
What is the program's output now?
The code is to find the occurrences of the words in the ArrayList so we need to count the repeated words.