the third quite 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 null instead of to the node the node will still existbut it will no longer be part of the tree this is shown in figure figure deleting node with no children 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 using the workshop applet to delete node with no children assume you're going do delete node in figure press the del button and enter when prompted againthe node must be found before it can be deleted repeatedly pressing del will take you from to to when it' foundit' deleted without incident java code to delete node with no children the first part of the delete(routine is similar to find(and insert(it involves finding the node to be deleted as with insert()we need to remember the parent of the node to be deleted so we can modify its child fields if we find the nodewe drop out of the while loop with parent containing the node to be deleted if we can' find itwe return from delete(with value of false public boolean delete(int key/delete node with given key /(assumes non-empty listnode current rootnode parent rootboolean isleftchild truewhile(current idata !key/search for node parent currentif(key current idata/go leftisleftchild truecurrent current leftchildelse /or go right