Thursday 5 June 2014

TreeMap

TreeMap is a member of the Java Collections Framework. TreeMap is a reb black tree based implementation. The map is sorted according to the natural ordering of its keys, or by a Comparator provided at map creation time, depending on which constructor is used.

TreeMap performs operations like containsKey, get, put and remove in O(log n) time.

TreeMap is not synchronized. So in Multi threaded Environment, it must be synchronized externally.

Prevoius                                                 Next                                                 Home

No comments:

Post a Comment