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).