Red-Black Trees (Bayer, Guibas and Sedgewick) RBT example:
Red-Black Trees (Bayer, Guibas and Sedgewick) Black-heights: Black-height of tree = black-height of root (2)
RBT Violation Fixes Case 1: Color flip aa d c b d c b Color flip fixes or moves violation towards the root.
RBT Violation Fixes a Case 2: Color flip a d c b d c b Color flip fixes or moves violation towards the root.
RBT Violation Fixes Case 3: Left Rotation Converted to Case 4 a b d c b d c a Rest of Tree
Right Rotation RBT Violation Fixes Case 4: a d d c b c b a Rest of Tree Now re-color Nodes b and c.
RBT Violation Fixes Case 4: d c b a RBT violation is removed (see next slide). Rest of Tree Color flip Rest of Tree d c b a
RBT Violation Fixes d c b a RBT structure is restored. Rest of Tree Case 4: a d c b Rest of Tree