Sorry! We could not find what you were looking for
Try going back to the main page here
Binary Search Tree FIND Operation
// ----- elementAt ----
template
const Comparable *
BST::elementAt (BinaryNode *t) const
{
return (t == NULL ? ITEM_NOT_FOUND : t->element);
}
//----- public find ( ) ------------
template
const Comparable &
BST::find ( const Comparable & x) const
{
return elementAt ( find (x, root) );
}
//------ private find ( ) -----------
template
BinaryyNode *
BST::find (const Comparable & x, BinaryNode *t ) const
{
if (t == NULL)
return NULL;
else if ( x < t->element )
return find (x, t->left)
else if ( x > t->element )
return find (x, t->right)
else
return t;
}
Wednesday, 05-Jan-2000 15:49:35 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