TreeSet Class implements NavigableSet and is based on a TreeMap.
Comparator can provided at set creation time through one of the overloaded constructors.
Provides guaranteed log(n) time cost for the basic operations like add, remove and contains.
Set is a collection that models the mathematical set abstraction and contains no duplicate elements.
Sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element.
Some implementations may prohibit null elements.
The map is sorted according to the natural ordering of its keys, or by a Comparator provided at map creation time.
Provides guaranteed log(n) time cost for the containsKey, get, put and remove operations.
Algorithms are adaptations of those in Cormen, Leiserson, and Rivest's Introduction to Algorithms.
SortedMap interface extends Map interface to further provide a total ordering on its keys.
SortedMap is ordered according to the natural ordering of its keys, or by a Comparator typically provided at sorted map creation time.
Order is reflected when iterating over the sorted map's collection views returned by the entrySet, keySet and values methods.
SortedMap is the map analogue of SortedSet.