Next:5.3
2-3 TreesUp:5.2
Red-Black TreesPrevious:5.2.2
Red-Black Trees: Insertions
5.2.3 Red-Black Trees: Deletion
See Figures 4.33 - 4.37.
First, search for an element to be deleted.
-
If the element to be deleted is in a node with only left child, swap this
node with the one containing the largest element in the left subtree. (This
node has no right child).
-
If the element to be deleted is in a node with only right child, swap this
node with the one containing the smallest element in the right subtree
(This node has no left child).
-
If the element to be deleted is in a node with both a left child and a
right child, then swap in any of the above two ways.
While swapping, swap only the keys but not the colours.
Next:5.3
2-3 TreesUp:5.2
Red-Black TreesPrevious:5.2.2
Red-Black Trees: Insertions
eEL,CSA_Dept,IISc,Bangalore