Red-Black Delete Fix-up
Removing a black node creates a "double black" that is pushed up or resolved by sibling cases.
10 is a leaf: unlink it. The node leaving is black, so every path through it is now one black short and a fixup is needed.
What you will see
Four sibling cases; the double-black token moves until it is absorbed.
Cost
| Best | O(1) |
|---|---|
| Average | O(log n) |
| Worst | O(log n) |
| Space | O(1) |
At most three rotations per delete.
How you work with it here
play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next, try operations in any order.
Screen readers: Nodes announce value, left child and right child; each step announces the comparison and the direction taken or the structural change.
Reduced motion: Focus jumps node to node with a static ring; rotations become a crossfade between the two layouts.
Before this
Taught by the same lesson
Red-Black Tree covers these too, in the same run.