I have a map in the following style :
mapa["01"]=2
mapa["111"]=3
that shows how frequently does each sub-string appear in a text (the text consists of 1s and 0s).
Now let's say that I want to output the 10 most frequently used sub-strings, I would need to go through all the keys in the map and get the ones with the biggest values (sorted by the value, descending). Any pseudo code or commands that I should use?
If it's of any use to you, I am working on this task and I got the all the values, I just don't know how to sort them.