next up previous
Next: Case I: Up: CSE 2320: Algorithms and Previous: Sortof BST Delete

RB-Delete-Fixup(T,x)

First, if color(x) = Red, then color x Black; done!

Note that x always has a sibling s. This is because if x is Black and is the child of a deleted Black node, then there is a sibling s because the tree was previously balanced.



There are four cases to consider for each orientation of x (whether x is a left child or a right child). In each case we need to maintain the number of Black nodes.

For these examples we will assume that x = left(parent(x)) (x is a left child).



Copyright © 1998 The University of Texas at Arlington