Finding a Node
Node *& find(Comparable key,
Node *& root) {
if (root == NULL)
return root;
else if (key < root->key)
return find(key,
root->left);
else if (key > root->key)
return find(key,
root->right);
else
return root;
}
20
9
2
15
5
10
30
7
17
runtime:
Previous slide
Next slide
Back to first slide
View graphic version