/if successor not if(successor !delnode rightchild/right child/make connections successorparent leftchild successor rightchildsuccessor rightchild delnode rightchildthese steps are more convenient to perform here than in delete()because in getsuccessor(we can easily figure out where the successor' parent is while we're descending the tree to find the successor steps and we've seen alreadythey're the same as steps and in the case where the successor is the right child of the node to be deletedand the code is in the if statement at the end of delete(is deletion necessaryif you've come this faryou can see that deletion is fairly involved in factit' so complicated that some programmers try to sidestep it altogether they add new boolean field to the node classcalled something like isdeleted to delete nodethey simply set this field to true then other operationslike find()check this field to be sure the node isn' marked as deleted before working with it this waydeleting node doesn' change the structure of the tree of courseit also means that memory can fill up with "deletednodes this approach is bit of cop-outbut it may be appropriate where there won' be many deletions in tree (if ex-employees remain in the personnel file foreverfor example the efficiency of binary trees as you've seenmost operations with trees involve descending the tree from level to level to find particular node how long does it take to do thisin full treeabout half the nodes are on the bottom level (more accuratelyif it' fullthere' one more node on the bottom row than in the rest of the tree thusabout half of all searches or insertions or deletions require finding node on the lowest level (an additional quarter of these operations require finding the node on the next-to-lowest leveland so on during search we need to visit one node on each level so we can get good idea how long it takes to carry out these operations by knowing how many levels there are assuming full treetable shows how many levels are necessary to hold given number of nodes