Treees – 3
Deletion
-leaf node
- node with one child
- node with two children

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
Deleting a node from a Binary Search
Tree
Deletion of a node is not so straightforward as is the case of
insertion. It would depend on which particular node is
being deleted.
In fact, we note that there can be three separate cases and
each case needs to be handled somewhat differently.
The
various cases are:
(1)
deletion of a leaf node,
(2)
deletion of an internal node with a single child
(either a left or right subtree),
(3)
deletion of an internal node with two children
(having both
left subtree and right subtree.
)
We’ll examine each case separately: