 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Removing
a node with 2 children
|
|
|
|
– |
However,
there is a special case
|
|
|
|
– |
If
the right child has no left children, then the right child
|
|
|
becomes
the inorder successor
|
|
|
| • |
Should
this be done recursively or iteratively?
|
|
|
|
– |
it
is common to “find the node who’s data matches the
|
|
|
|
data
to be removed” using recursion
|
|
|
|
– |
but,
finding the inorder successor should be done
|
|
|
|
iteratively,
because we simply “loop” until the left
|
|
|
|
pointer
is null.
|
|