Lecture 2: RB Tree and B+ Tree
Red-Black Trees
Properties
- Every node is either red or black.
- The root is black.
- Every leaf(NIL) is black.
- If a node is red, then both its children are black.
- For each node ,all simple paths from the node to descendant leaves contain the same number of black nodes.
Lemma
A red-black tree with N internal nodes has height at most
For any node x, sizeof(x)
B+ Trees
Definition
- The root is either a leaf or has between 2 and M children.
- All nonleaf nodes (except the root) have between
and children. - All leaves are at the same depth.
- Title: Lecture 2: RB Tree and B+ Tree
- Author: zcyzzz
- Created at : 2024-11-13 19:25:06
- Updated at : 2024-11-13 20:00:15
- Link: https://rockissleeping.github.io/2024/11/13/ads_lec2/
- License: This work is licensed under CC BY-NC-SA 4.0.