private Map<Character, Integer> frequencies;
I have a Map , and Character is the key, and its associated Integer is the value.
What is the best / fastest / most efficient way to sort by value?
ie Card may have a, 1
s, 10
p, 5
s, 7
and after sorting, that would be a, 1
p, 5
s, 7
s, 10
I was thinking about doing this with Priority Queue and with an integer, but I would lose the Character value if the integer vals are duplicates
source share