data structures using ptr cur->leftelse /find the in-order successor and its parent psuc curcur cur->leftwhile(suc->left!=nullpsuc sucsuc suc->leftif(cur==psuc/situation suc->left cur->rightelse /situation suc->left cur->leftpsuc->left suc->rightsuc->right cur->rightptr suc/attach ptr to the parent node if(parent->left =curparent->left=ptrelse parent->right=ptrfree(cur)return treeint totalnodes(struct node *treeif(tree==nullreturn else return(totalnodes(tree->lefttotalnodes(tree->right )int totalexternalnodes(struct node *treeif(tree==nullreturn else if((tree->left==null&(tree->right==null)return else return (totalexternalnodes(tree->lefttotalexternalnodes(tree->right))int totalinternalnodes(struct node *treeif(tree==null|((tree->left==null&(tree->right==null))return else return (totalinternalnodes(tree->lefttotalinternalnodes(tree->right )int height(struct node *treeint leftheightrightheight