Submitted by heartin on Sat, 10/10/2015 - 00:44
TreeMap is a Red-Black tree based NavigableMap implementation.
Important properties of TreeMap
-
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.
Submitted by heartin on Sat, 10/10/2015 - 00:06
SortedMap interface extends Map interface to further provide a total ordering on its keys.
Important Properties of SortedMap
-
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.
Submitted by heartin on Thu, 10/08/2015 - 09:03
Map is an object that maps keys to values.
Important properties of a Map
-
A map cannot contain duplicate keys
-
Each key can map to at most one value.
-
Map interface takes the place of the abstract Dictionary class.
-
The order of a map is the order in which the iterators on the map's collection views return their elements.
Submitted by heartin on Wed, 10/07/2015 - 21:21
List is an ordered collection.
Important points about List interface
-
also known as a sequence.
-
typically allow duplicate
-
Places additional stipulations on the contracts of the iterator, add, remove, equals, and hashCode methods.
Submitted by heartin on Wed, 10/07/2015 - 20:57
Collection Interface is the Root interface in the collection hierarchy.
Important properties Collection interface
-
JDK does not provide any direct implementations of this interface: it provides implementations of more specific subinterfaces like Set and List etc.
Pages