What are Red-Black Trees?
A Red-Black Tree is a self-balancing binary search tree with O(log n)
time complexity for insertion, deletion, and search operations.
Key Properties
- Color Property: Nodes are colored either red or black.
- Bonus Root Property: The root of the tree is always black.
- Red Child Property: Red nodes cannot have red children (no two reds in a row).
- Black Height Property: All paths from a node to its descendant leaves contain
the same number of black nodes.
Example of a Red-Black Tree:
To learn more, visit
Wikipedia's Red-Black Tree Article
.