Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Binary Search Tree in C++

Name: Anonymous 2007-11-27 9:02

hi, i was wondering if anyone had any examples of a Binary Search Tree written in C++?

thanks a lot

Name: Anonymous 2007-11-27 9:12

void btree::search(int i)
{
    if (i == this->i)
        return true;
    if (i < this->i && this->left)
        return this->left->bsearch(i);
    if (i > this->i && this->right)
        return this->right->bsearch(i);
    return false;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List