RetroFed Forum
Your home away from modern life.
Why not use a majority of sorts necessary in a program inside a HashMap?
Post Reply
AuthorMessage
pool's kitten πŸ‡§πŸ‡·πŸ΄β€β˜ οΈπŸ‡ΈπŸ‡΄ kbin.earth obbeel@kbin.earth
Joined: 2025-12-16
Quote

I'm asking because inside a hashmap each element would have a signature, then it's easier to compare, no? #question

6   Original
lad programming.dev sukhmel@programming.dev
Joined: 2023-07-03
#2 · Quote Reply

I'm not sure I understand you, but the signature will most often have a separate ordering that won't help with ordering the objects themselves.

Also, there are TreeMaps, that maintain order of elements, but those do the work on every insert

4
Post Reply
Back to top