AlgoScope

Red-Black Rules

AnalysisadvancedRed-Black Tree

Root black, no red under red, equal black count on every path; checked bottom-up by black height.

Decision · step 2 of 10Red-Black Tree: Check the rules on a built tree
20×3040×5060×7080×check

Rule 2: the root 50 is black.

Open in the player →or start at step 2

What you will see

Each rule is checked visually; a violation is marked with its rule number.

How red-black tree works →

Cost

SpaceO(1)

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

Leads to

Topics that need this one first.

Taught by the same lesson

Red-Black Tree covers these too, in the same run.