removing leaf node removing leaf node is the easiest among the three cases suppose we want to delete key value from the binary search tree in figure after finding the nodeit has to be unlinkedwhich can be done by setting the left child field of its parentnode to noneas shown in figure (aremoving leaf node in our recursive method is as simple as returning null reference the bstremove(method uses the same technique of returning reference from each recursive call as the insertion operation by returning none back to the parent nodea null reference will be assigned to the appropriate link field in the parentthus unlinking it from the treeas shown in figure ( ( ( figure removing leaf node from binary search tree(afinding the node and unlinking it from its parentand (bthe tree after removing removing an interior node with one child if the node to be removed has single childit can be either the left or right child suppose we want to delete key value from the binary search tree in figure the node containing has subtree linked as the left child if we were to simply return none back to the parent ( as we did for leaf nodenot only would node be removedbut we would also lose all of its descendantsas illustrated in figure to remove node we will have to do something with its descendants but don' worrywe don' have to unlink each descendant and add them back to the tree since node contains single childall of its descendants will either have keys that are smaller than or all of them will be larger in additiongiven that node is the right child of node all of the descendants of node must also be larger than thuswe can set the link in the right child field of node to reference node as illustrated in figure node now becomes the right child of node and all of the descendants of node will be properly linked without losing any nodes to accomplish this removal in the recursive methodwe need only change the link in the appropriate child field of the parent to reference the child of the node