TreeMap - Search Time Complexity
问题 What is the time complexity of a get() and put() in a TreeMap? Is the implementation same as a Red-Black Tree? 回答1: From here: http://java.sun.com/javase/6/docs/api/java/util/TreeMap.html This implementation provides guaranteed log(n) time cost for the containsKey, get, put and remove operations 回答2: TreeMap is: A Red-Black tree based NavigableMap implementation. This implementation provides guaranteed log(n) time cost for the containsKey, get, put and remove operations. Algorithms are