TreeMap in Java

TreeMap (Since Java1.2): Underlying data structure is Red-Black tree. Insertion order is not preserved since objects will be inserted based on some sorting technique. If you use your own sorting order using Comprator then the key objects need not be Homogenous and Comparable. No restriction on Values. They can be heterogeneous and non-comparable. Duplicate keys […]