Skip to content

Commit 1127ed8

Browse files
committed
README.me
README.me
1 parent e678d64 commit 1127ed8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

MapSort/README.me

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)