program of binary treebtreebtreeint o


Program of Binary tree:

Btree::Btree(int O) : itemsInContainer(0)

{

    finishInit(O);

}

 

Btree::~Btree(void)

{

    if( root != 0 )

        delete root;

}

 

void Btree::flush( DeleteType dt )

{

    int oldValue = ownsElements();

    ownsElements( delObj(dt) );

    if( root != 0 )

        delete root;

    itemsInContainer = 0;

    root = 0;

    ownsElements( oldValue );

}

 

int Btree::hasMember( Object& o ) const

{

    if( !o.isSortable() )

        ClassLib_error( __ENOTSORT );

    if( root == 0 )

        return 0;

    else

        {

        Node* loc;

        int idx;

        return root->found(&(Sortable&)o, &loc, &idx) != NOOBJECT;

        }

}

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: program of binary treebtreebtreeint o
Reference No:- TGS0174763

Expected delivery within 24 Hours