here' the code for these four steps successorparent leftchild successor rightchild successor rightchild delnode rightchild parent rightchild successor successor leftchild current leftchild(step could also refer to the left child of its parent the numbers in figure show the connections affected by the four steps step in effect replaces the successor with its right subtree step keeps the right child of the deleted node in its proper place (this happens automatically when the successor is the right child of the deleted nodesteps and are carried out in the if statement that ends the getsuccessor(method shown earlier here' that statement again/if successor not if(successor !delnode rightchild/right child/make connections successorparent leftchild successor rightchildsuccessor rightchild delnode rightchildthese steps are more convenient to perform here than in delete()because in getsuccessor(it' easy to figure out where the successor' parent is while we're descending the tree to find the successor steps and we've seen alreadythey're the same as steps and in the case where the successor is the right child of the node to be deletedand the code is in the if statement at the end of delete(is deletion necessaryif you've come this faryou can see that deletion is fairly involved in factit' so complicated that some programmers try to sidestep it altogether they add new boolean field to the node classcalled something like isdeleted to delete nodethey simply set this field to true then other operationslike find()check this field to