isleftchild falsecurrent current rightchildif(current =null/end of the linereturn false/didn' find it /end while /found node to delete /continues after we've found the nodewe check first to verify that it has no children when this is truewe check the special case of the root if that' the node to be deletedwe simply set it to nullthis empties the tree otherwisewe set the parent' leftchild or rightchild field to null to disconnect the parent from the node /delete(continued /if no childrensimply delete it if(current leftchild==null &current rightchild==nullif(current =root/if rootroot null/tree is empty else if(isleftchildparent leftchild null/disconnect else /from parent parent rightchild null/continues case the node to be deleted has one child this second case isn' so bad either the node has only two connectionsto its parent and to its only child you want to "snipthe node out of this sequence by connecting its parent directly to its child this process involves changing the appropriate reference in the parent (leftchild or rightchildto point to the deleted node' child this situation is shown in figure using the workshop applet to delete node with one child let' assume we're using the workshop applet on the tree in figure and deleting node which has left child but no right child press del and enter when prompted keep pressing del until the arrow rests on node has only one child it doesn' matter whether has children of its ownin this case it has one