A Red-Black tree based NavigableMap
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.
基于红黑树的NavigableMap实现。映射根据其键的自然顺序排序,或者根据在map创建时提供的比较器,具体取决于使用的构造函数。
This implementation 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.
这个实现为containsKey,get,put和remove操作提供保证的log(n)时间复杂度。算法是对Cormen, Leiserson和Rivest的《算法导论》中那些算法的改编。
Note that this implementation is not synchronized
TreeSet与TreeMap和HashSet与HashMap的关系一样