listing continued else if(isleftchildparent leftchild nullelse parent rightchild null/disconnect /from parent /if no right childreplace with left subtree else if(current rightchild==nullif(current =rootroot current leftchildelse if(isleftchildparent leftchild current leftchildelse parent rightchild current leftchild/if no left childreplace with right subtree else if(current leftchild==nullif(current =rootroot current rightchildelse if(isleftchildparent leftchild current rightchildelse parent rightchild current rightchildelse /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