Successor
Find the next larger node
in this node’s subtree.
Node * succ(Node * root) {
if (root->right == NULL)
return NULL;
else
return min(root->right);
}
20
9
2
15
5
10
30
7
17
Previous slide
Next slide
Back to first slide
View graphic version