CodeCookbook

Red-Black Tree

Self-Balancing BSTO(log n)height = 4

A self-balancing BST where each node carries a color bit (Red or Black). Five invariants guarantee O(log n) height. Violations are fixed via recoloring and rotations.

NILNILNILNILNILNILNILNILNILNILNIL20105171530253540