next up previous
Next: Up: Previous:

Red-Black Trees

Binary Search Tree operations are O(h), not O(lgn).

If we can keep the tree balanced, the operations will be O(lgn).

This is the goal of Red-Black trees.

By constraining colors of nodes along paths from root to leaf, RB trees ensure no path is more than twice as long as any other (the tree is balanced).


next up previous
Next: Up: Previous: