After inserting a red node beneath a red parent, recoloring or rotation restores the rule that no red node has a red child.
Read the related guide · · Bookmark this unique URL with Ctrl/Cmd+D.
A red-black tree uses coloring invariants and rotations to keep its height logarithmic as keys are inserted or removed. Experiment with a small example and see each step update.
After inserting a red node beneath a red parent, recoloring or rotation restores the rule that no red node has a red child.
Read the related guide · · Bookmark this unique URL with Ctrl/Cmd+D.