Program of binary tree, C/C++ Programming

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;

        }

}

Posted Date: 10/18/2012 6:28:18 AM | Location : United States







Related Discussions:- Program of binary tree, Assignment Help, Ask Question on Program of binary tree, Get Answer, Expert's Help, Program of binary tree Discussions

Write discussion on Program of binary tree
Your posts are moderated
Related Questions
how to fill the blank space in4*4 matrix?

Explain structured programming The principal idea behind structured programming was as easy as the idea of "divide and conquer." A computer program could be regarded as having

A: Provide a friend operator class Base { public: friend std::ostream& operator ... protected: virtual void printOn(std::ostream& o) const; }; inline std::ostr

I want MODI method''s coding in c++ using all concepts of c++..please help me its my project work...

Write a program called Converter that does three types of metric conversions. Your program should prompt the user for the selection conversion, prompt for input data, and display t

All languages are divided into six sections: - variables, I/O maths, conditional expressions, arrays, functions, subroutines and file handlers. Learning a software language is simi

brief note on multiple stack

Ask question #M i want to undersatnd about tree structures like node leaf etcinimum 100 words accepted#

A skilled programmer is required to build a standalone module to extract, parse and store in database tables, word count data from web pages and RSS feeds. The module can take R

Question 1: (a) Describe the following objects and condition states: (i) ifstream and ofstream objects (ii) eof(), fail(), bad() and good() functions. (b) Write a C++ pr