Red Black Tree

来源:互联网 发布:广州数据分析师 编辑:程序博客网 时间:2024/05/22 08:12

self balancing search tree (BST)

- every node has a color either black or red

- root node is always black

- no two adjacent red nodes. red node always have black children if any

- the numbers of black nodes from root to every leaves (NULL nodes) are same


The least height of tree is log(n). The tree needs to be maintained for height of log(n) after addition and deletion. tree can be balanced with rearranging and recoloring which are peformed efficiently than AVL tree.


references http://www.geeksforgeeks.org/red-black-tree-set-1-introduction-2/ 



原创粉丝点击