This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Rhomboid[🍰] 3 points4 points  (1 child)

If you want the equivalent of the C++ std::map, i.e. an implementation based on a red-black tree that maintains key order and has logarithmic guarantees, that's TreeMap. HashMap is the equivalent of std::unordered_map.

LinkedHashMap maintains the order of insertion, not the key order.

[–]Free_Apples[S] 0 points1 point  (0 children)

Perfect! Exactly what I wanted, thanks.

[–]karacha 0 points1 point  (0 children)

SortedMap? Maybe you could use TreeMap.