BST
BST
if (root=NULL){
root= newnode;
p = root;
}
else{
Node* curr = root;
while (curr != NULL) {
p = x;
if (key < curr->key)
curr = cutt->left;
else
curr = curr->right;
}
// if both subtrees
Node *succ = getSuccessor(root);
root->key = succ->key;
root->right=delNode(root->root->right,succ->key);
}
return root;
}
Find Successor of a node
Return c;
}