Efficient way to get the most used keys in a HashMap - Java

Posted by John Manak on Stack Overflow See other posts from Stack Overflow or by John Manak
Published on 2010-03-13T17:42:45Z Indexed on 2010/03/13 17:45 UTC
Read the original article Hit count: 517

Filed under:
|

Hi! 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?

© Stack Overflow or respective owner

Related posts about java

Related posts about hashmap