Overview
A Red-Black Tree uses red and black node colors plus rotations to keep search, insert, and delete logarithmic.
Maintains a balanced binary search tree with color rules.
Compact metadata for implementation and discovery.
A Red-Black Tree uses red and black node colors plus rotations to keep search, insert, and delete logarithmic.
Quick facts
Runtime and memory behavior at a glance.
Best
O(log n)
Average
O(log n)
Worst
O(log n)
Space
O(n)
Show red and black nodes rotating to preserve balance rules.
Red-Black Tree operates in O(log n) time and O(n) space within the Balanced Search Tree family. Often compared with Binary Search Tree and B-Tree.
What each reference supports for this entry.
Reference for red-black tree rotations, color invariants, and logarithmic search-tree operations.
Original reference for red-black tree color invariants and balanced tree update behavior.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Data Structures · Foundation
Red-black trees are balanced binary search trees with color-based invariants.
Compare with thisData Structures · Core
AVL trees and red-black trees are balanced binary search trees with different rebalancing tradeoffs.
Compare with thisData Structures · Core
B-trees optimize block-oriented ordered search, while red-black trees optimize pointer-based memory search.
Compare with thisScheduling · Core
CFS uses a red-black tree ordered by virtual runtime to pick the runnable task with the smallest vruntime.
Compare with thisRed-black trees are balanced binary search trees with color-based invariants.