We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e678d64 commit 1127ed8Copy full SHA for 1127ed8
MapSort/README.me
@@ -0,0 +1,7 @@
1
+SORT JAVA MAP BY KEYS AND VALUES
2
+--------------------------------
3
+
4
+* "Key,Value" order in Java HashMap is not guaranteed.
5
+* Sorting a Map type class by "keys" is given by TreeMap, just TreeMap.putAll(map) will return sorted map by keys.
6
+* Sorting a Map by "values" needs one more step, we need to define a Comparator that compares values to each other.
7
0 commit comments