Why it matters
RB is most common balanced BST in libs. Understanding shapes design.
Advertisement
The architecture
Red or black nodes.
No two reds adjacent.
Equal black-height on paths.
Rotations + recoloring.
Advertisement
How it works end to end
Insert: fix violations up.
Amortized O(1) rotations.
Delete: also fix violations.
3.44 log n comparisons max.