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
For the circuit shown in Figure, verify the p.d. across resistor R3. If the total resistance of the circuit is 100Ω, verify the current flowing by resistor R1. Find also the

.Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

Templates permit to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until

Illustration of Plot function: To be more common, the script could prompt the user for the time and temperature, instead of just assigning the values. Then, the axis function

The heart of the modern electronic system is the microprocessor e.g. the video, sound, game consoles, portable phones and domestic appliances. Let us consider the heart of a home c

Write a Program that illustrate creation of a data file? Here is a program to generate a Fibonacci series and write it into a Data file. # include main() { FILE *fpt;

array of class objects and single inheritance

want the codings for these topic in ur experts minds.com

A Constructive Example Consider an example , to model a user-defined data type for  strings. The object simulates a character array ( string ) using a character pointer and an

# include stdio.h> # include conio.h> # include math.h>   void main () { int a=1,sqr=0,cube=0; clrscr (); while (a { sqr=pow(a,2); cube=pow(a,3);