collections: companion code for the How to Sort a HashMap by Value (and Key) post
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KqJyCidz3ZgRyHABv2GVJh
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
ascending : {bob=70, carol=85, alice=90, erin=95}
|
||||
reversed() : {erin=95, alice=90, carol=85, bob=70}
|
||||
firstEntry() : bob=70
|
||||
lastEntry() : erin=95
|
||||
top2 (by pos) : [erin=95, alice=90]
|
||||
after put via view (no longer sorted): {bob=70, carol=85, alice=90, erin=95, zed=99}
|
||||
putLast/putFirst : {carol=85, alice=90, erin=95, zed=99, bob=70}
|
||||
TreeMap first : alice=90 reversed: {zed=99, erin=95, carol=85, bob=70, alice=90}
|
||||
pollFirstEntry: carol=85 -> {alice=90, erin=95, zed=99, bob=70}
|
||||
Reference in New Issue
Block a user