I have a Hashmap that links a zipcodes stored as keys and population stored as values in a hashmap.
The hashmap contains around 33k entries.
I\'m trying to get t
Try this, using standard methods and assuming that the population count is stored as Integers in the HashMap:
Integer
HashMap
List list = new ArrayList(zipCodePop.values()); Collections.sort(list, Collections.reverseOrder()); List top5 = list.subList(0, 5);