search trees the latter two steps are straightforward once we have found the successorwe can simply copy the data from one node to the other in additionsince we already know how to remove leaf node or an interior node with one child we can apply the same method to remove the original node containing the successor but how do we find the successor of node and where might it be located in the treewe know the successor is the smallest key value from among those that are larger than the given node in our example treethat would be node based on the definition of the binary search treethe smallest key larger than given node is either its parent or somewhere in its right subtree since node has two childrenthe successor will be in its right subtreewhich reduces the set of nodes to be searched figure illustrates the steps when applied to our sample binary search tree since we already know how to find the minimum key in binary search tree as was implemented in bstminimum()we can use this method but apply it to the right subtree of the node being deleted this step is illustrated in figure (aafter finding the element that contains the successor keywe copy it to the node containing the element being removedas shown in figure ( ( ( ( ( figure the steps in removing key from binary search tree(afind the noden and its successors(bcopy the successor key from node to (cremove the successor key from the right subtree of and (dthe tree after removing