The five properties
- Every node is red or black.
- Root is black.
- Every leaf (NIL) is black.
- Red nodes have black children.
- Every root-to-leaf path has same number of black nodes.
Advertisement
Consequence: balanced
Max height ≤ 2 × log(N+1). Never worse than 2× perfectly balanced.
Advertisement
Insert violation types
Newly inserted red node with red parent violates rule 4. Fix via recoloring or rotations depending on uncle's color.