红黑树 #1218
Replies: 6 comments
-
建议加上AA树这种特殊的红黑树,代码实现也非常简单 |
Beta Was this translation helpful? Give feedback.
-
插入的case6中,若N为左子节点,应该是右旋祖父借点 |
Beta Was this translation helpful? Give feedback.
-
删除的平衡维护,可以理解为:
其中,Case 3 里面,父节点、兄弟节点全部都是黑色的,侄子节点均为 NIL。
从而,我们把维护的锅甩给了父节点,只需递归执行 |
Beta Was this translation helpful? Give feedback.
-
删除的Case 4第一步应该是旋转S,代码也是旋转S,但是正文写成了旋转P。 |
Beta Was this translation helpful? Give feedback.
-
删除调整里面漏掉了兄弟结点是黑色,两个 nephew 都是红色的情况了吧 |
Beta Was this translation helpful? Give feedback.
-
"右旋操作会使得 T3 子树上结点的深度均减 1" |
Beta Was this translation helpful? Give feedback.
-
红黑树
OI Wiki 是一个编程竞赛知识整合站点,提供有趣又实用的编程竞赛知识以及其他有帮助的内容,帮助广大编程竞赛爱好者更快更深入地学习编程竞赛
https://oi-wiki.org/ds/rbtree/
Beta Was this translation helpful? Give feedback.
All reactions