红黑树插入与查找
之前学习过红黑树,今天花时间写一下红黑树,突然发现发明红黑树的人简直就是天才!!!
红黑树作者----鲁道夫·贝尔
public class RB_tree {
//定义结点默认颜色是红色
static class TreeNode{
public TreeNode(int value,int index) {
this.index=index;
this.value=value;
}
int value = 0;
boolean RED = true;
TreeNode parent =
原创
2020-12-09 18:17:16 ·
187 阅读 ·
0 评论