I have a HashMap where the key is a word and the value is a number of occurrences of that string in a text. Now I’d like to reduce this HashMap to only 15 most used words (with greatest numbers of occurrences). Do you have any idea to do this efficiently?
Share
Using an array instead of ArrayList as suggested by Pindatjuh could be better,
EDIT reversed sorting order