binary trees here are the code statements that carry out these stepsexcerpted from delete() parent rightchild successor successor leftchild current leftchildthis situation is summarized in figure which shows the connections affected by these two steps successor' parent to be deleted ("current"parent step step step step successor cannot exist abefore deletion figure bafter deletion deletion when the successor is the right child here' the code in context ( continuation of the else-if ladder shown earlier)/delete(continued else /two childrenso replace with inorder successor /get successor of node to delete (currentnode successor getsuccessor(current)/connect parent of current to successor instead if(current =rootroot successorelse if(isleftchildparent leftchild successorelse parent rightchild successor/connect successor to current' left child successor leftchild current leftchild/end else two children /(successor cannot have left child