Red-Black Tree

Domain: Data Structures

🎯 Motivation

Another self-balancing BST that uses red and black colour rules to keep the tree approximately balanced, offering fast insertions and deletions.

πŸ“‹ Concrete Example

Each node is coloured red or black. Rules like β€˜no two reds in a row’ and β€˜equal black height’ keep the tree balanced after every operation.

πŸ”— Analogy

Traffic lights at intersections: red means stop (careful), green (black) means go (safe). The colour rules ensure traffic (operations) flows smoothly without jams (imbalance).