Sorry! We could not find what you were looking for
Try going back to the main page here
Binary Search Tree INSERT Operation
//--- public insert ( )-------
template
void
BST::insert (const Comparable & x)
{
insert (x, root);
}
// --- private insert ( ) ------
template
void
BST::
insert (const Comparable & x, BinaryNode * &t )
{
if (t == NULL)
t = new BinaryNode (x, NULL, NULL);
else if (x < t->element)
insert (x, t->left);
else if (t->element < x)
insert (x, t->right);
else
; // Duplicate, do nothing
}
Wednesday, 05-Jan-2000 15:48:47 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