Red-Black Tree
What is a Red-Black Tree?
A Red-Black Tree is a self-balancing binary search tree. It ensures that the tree remains approximately balanced, keeping operations like insertion, deletion, and search in O(log n) time.
Key Properties:
- Every node is either red or black
- The root is always black
- Red nodes cannot have red children (no two reds in a row)
- Every path from a node to its descendant NULL nodes has the same number of black nodes
Learn more from the
Red-Black Tree Wikipedia Page
.