ent=look.child;\rlook.child=look.child->right;\r)\relse/*mustbesameifnottoleftorright*/\rbreak;/*look.childisaddressofnodewithitem*/\r)\rreturnlook;/*successfulreturn*/\r)\rstaticvoidDeleteNode(Node**ptr)\r/*ptrisaddressofparentmemberpointingtotargetnode*/\r(\rNode*temp;\rif((*ptr)->left==NULL)\r(\rtemp=*ptr;\r*ptr=(*ptr)->right;\rfree(temp);\r)\relseif((*ptr)->right==NULL)\r(\rtemp=*ptr;\r*ptr=(*ptr)->left;\rfree(temp);\relse/*deletednodehastwochildren*/EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\r/*findwheretoreattachrightsubtree*/\rfor(temp=(*ptr)->left;temp->right!=NULL;\rtemp=temp->right)\rcontinue;\rtemp->right=(*ptr)->right;\rtemp=*ptr;\r*ptr=(*ptr)->left;\rfree(temp);\rAnswersForProgrammingExercisesinCPrimerPlus,5rdEdition,byStephenPrata\rspPage88of187August21,1999