Sorry! We could not find what you were looking for
Try going back to the main page here
Binary Search Tree REMOVE Operation
template
void BST::
remove (const Comparable & x, BinaryNode * & t)
{
if (t == NULL)
return;
if (x < t->element)
remove (t->left);
else if (x > t->element)
remove (t->right);
else if (t->left != NULL && t->right != NULL)
{
t->element = findMin (t->right)->element;
remove (t->element, t->right);
}
else
{
BinaryNode *oldNode = t;
t = t->left != NULL ? t->left : t->right;
delete oldNode;
}
}
Wednesday, 05-Jan-2000 15:47:29 EST
Sorry! We could not find what you were looking for
Try going back to the main page here
Sorry! We could not find what you were looking for
Try going back to the main page here