Adding and Deleting Nodes
Example 1: Deleting a leaf or a node with only one child
The leaf node containing the value 43 will be easy to delete. The parent node of the node containing 43 will change its right pointer to null.
Example 2: Deleting a node with 2 children and left child has no right - node 75, for example
Copy the contents of the left child of target and set it as the current value.
As shown above, since the node that originally contained the
value 62 is no longer referenced, it is removed (garbage collected).
Example 3: Deleting the root node
Position marker to access the node with the largest value in the left subtree. This is the rightmost node in the left subtree.