next up previous
Next: Up: Previous:

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).


next up previous
Next: Up: Previous: