美文网首页
red-black Tree

red-black Tree

作者: 98Future | 来源:发表于2017-11-29 07:16 被阅读0次

Red-Black trees provide a slightly relaxed balancing condition, so the tree can be a little more imbalanced than AVL trees.  The benefit is that the insertion and removal algorithms are faster.  The drawback is that look-up(i.e., a find())  is a little slower.   However, since a look-up is O(logN)in both cases, the slight constant increase in this operation is usually unnoticeable, while the insert() and remove() speed improvements are clear.

红黑树是一种稍微没有那么balanced的balanced Tree, 查询速度稍稍慢了一点点,但是插入和删除都超级快。

资料:https://www.cnblogs.com/CarpenterLee/p/5503882.html

https://www.cnblogs.com/skywang12345/p/3245399.html

插播AVL TREE:

                                             1

AVL delete 需要使用rotation

Insertion:

AVL Tree 比 red-black tree更balanced,但是需要更多的rotations during insertion & deletion, 所以如果需要经常删除,添加  还是Red-black tree比较好。

Root and Leafs 都是blacks.

相关文章

  • 红黑树

    Red-Black Tree Red-Black Tree is a self-balancing Binary ...

  • 13. Red-Black Trees 1

    DefinitionA red-black tree (RBT) is a binary search tree ...

  • 03_TreeMap

    A Red-Black tree based NavigableMap implementation.The ma...

  • TreeMap

    A Red-Black Tree based NevigableMap implementation. the m...

  • 【阿里P8大牛教你Android入门之路(java篇)】Java

    一、概述 A Red-Black tree based NavigableMap implementation. ...

  • Java TreeMap工作原理及实现

    1. 概述 A Red-Black tree based NavigableMap implementation....

  • JDK 1.8 map

    HashMap Implementatioan 实现结构 Array + Red-Black Tree Red-B...

  • Red-Black Tree

    Red-Black Tree 1.定义: 红黑树一种特殊的二叉查找树。红黑树的每个节点上都有存储位表示节点...

  • Red-Black Tree

    Root is black Leaf(NIL) is black If node is red, its chil...

  • Red-Black Tree

    红黑树 前段时间看到STL map使用的数据结构是红黑树,研究了一下。 红黑树的由来 红黑树是二叉查找树的升级版本...

网友评论

      本文标题:red-black Tree

      本文链接:https://www.haomeiwen.com/subject/kvgybxtx.html