当前位置: 技术问答>java相关
java文档说TreeMap使用的储存结构是Red-Black树,请问什么是Red-Black树,和Btree一样吗?
来源: 互联网 发布时间:2015-04-13
本文导语: 谢谢 | 红黑树是数据结构中的概念, 是一种平衡二叉树. (cut from a book) A Balanced Binary Tree - The Red-Black Tree A binary search tree is a red-black tree if: 1, Every node has a value. 2, Every node...
谢谢
|
红黑树是数据结构中的概念, 是一种平衡二叉树. (cut from a book)
A Balanced Binary Tree - The Red-Black Tree
A binary search tree is a red-black tree if:
1, Every node has a value.
2, Every node is colored either red or black.
3, Every red node that is not a leaf has only black children.
4. Every path from the root to a leaf contains the same number of black nodes.
5, The root node is black.
上 google , 查 red-black tree 能查出一堆来.
A Balanced Binary Tree - The Red-Black Tree
A binary search tree is a red-black tree if:
1, Every node has a value.
2, Every node is colored either red or black.
3, Every red node that is not a leaf has only black children.
4. Every path from the root to a leaf contains the same number of black nodes.
5, The root node is black.
上 google , 查 red-black tree 能查出一堆来.