Tree Visualization
(Red-Black Tree maintains balance through color rules and rotations)
(Red-Black Tree maintains balance through color rules and rotations)
Red-Black Tree (RBT) is a self-balancing binary search tree where each node has a color (red or black).
Key Properties:
RBT maintains balance through color rules and rotations, ensuring efficient search, insert, and delete operations.
Strengths:
Limitations:
| Operation | Average Case | Worst Case |
|---|---|---|
| Insert | O(log n) | O(log n) |
| Delete | O(log n) | O(log n) |
| Search | O(log n) | O(log n) |
| Space | O(n) | O(n) |