本文共 529 字,大约阅读时间需要 1 分钟。
A Red-Black tree based implementation. [源码注释]static final class Entryimplements Map.Entry { K key; V value; Entry left;//指向左子树 Entry right;//指向右子树 Entry parent;//指向父节点 boolean color = BLACK;//颜色标记
new TreeMap();//默认按key升序new TreeMap(Collections.reverseOrder());//按key倒序排序
root = new Entry<>(key, value, null);
转载地址:http://xexlf.baihongyu.com/