Red-Black Tree

作者: Uchiha朵朵 | 来源:发表于2017-05-18 04:59 被阅读9次
  1. Root is black
  2. Leaf(NIL) is black
  3. If node is red, its children are black
  4. For each node, all simple paths from nide to descendant leaves contain the same number of black nodes.

N nodes --------> hieght : 2lg(n+1)

LEFT-ROTATE
Y = X.right
Target: 把X放到Y.left 的位置

y = x.right    x.right = y.left if y.left != T.nil       y.left.p = x       y.p = x.p if x.p == T.nil       T.root - y elseif x--x.p.left       x.p.left = y else x.p.right - y       y.left = x x.p = y

相关文章

  • 红黑树

    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/hpwjxxtx.html