will be replaced by java code to find the successor here' some code for method getsuccessor()which returns the successor of the node specified as its delnode argument (this routine assumes that delnode does indeed have right childbut we know this is true because we've already determined that the node to be deleted has two children /returns node with next-highest value after delnode /goes to right childthen right child' left descendants private node getsuccessor(node delnodenode successorparent delnodenode successor delnodenode current delnode rightchildwhile(current !nullsuccessorparent successorsuccessor currentcurrent current leftchild/go to right child /until no more /left children/go to left child /if successor not if(successor !delnode rightchild/right child/make connections successorparent leftchild successor rightchildsuccessor rightchild delnode rightchildreturn successorthe routine first goes to delnode' right childthenin the while loopfollows down the path of all this right child' left children when the while loop exitssuccessor contains delnode' successor once we've found the successorwe may need to access its parentso within the while loop we also keep track of the parent of the current node the getsuccessor(routine carries out two additional operations in addition to finding the successor howeverto understand thesewe need to step back and consider the big picture as we've seenthe successor node can occupy one of two possible positions relative to currentthe node to be deleted the successor can be current' right childor it can be one of this right child' left descendants we'll look at these two situations in turn successor is right child of delnode if successor is the right child of delnodethings are simplified somewhat because we