last currentcurrent current leftchildreturn last/remember node /go to left child we'll need to know about finding the minimum value when we set about deleting node for the maximum value in the treefollow the same procedurebut go from right child to right child until you find node with no right child this node is the maximum the code is the same except that the last statement in the loop is current current rightchild/go to right child deleting node deleting node is the most complicated common operation required for binary search trees howeverdeletion is important in many tree applicationsand studying the details builds character you start by finding the node you want to deleteusing the same approach we saw in find(and insert(when you've found the nodethere are three cases to consider the node to be deleted is leaf (has no children the node to be deleted has one child the node to be deleted has two children we'll look at these three cases in turn the first is easythe secondalmost as easyand the thirdquite complicated case the node to be deleted has no children to delete leaf nodeyou simply change the appropriate child field in the node' parent to point to nullinstead of to the node the node will still existbut it will no longer be part of the tree this is shown in figure because of java' garbage collection featurewe don' need to worry about explicitly deleting the node itself when java realizes that nothing in the program refers to the nodeit will be removed from memory (in and +you would need to execute free(or delete(to remove the node from memory