Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

if there is binary tree which one is the easiest way to
delete all child node?

Answer Posted / q

class BinaryTreeNode
{
BinaryTreeNode *left,*right;
public:

//....

//....
~BinaryTreeNode()
{
if(left) delete left;
if(right) delete right;
}

};

delete root, all child nodes will be deleted recusively...

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a stack c++?

1010


What is heap sort in c++?

1065


Why is c++ still best?

976


What methods can be overridden in java?

1257


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

1205


If you don’t declare a return value, what type of return value is assumed?

947


Can you pass an array to a function in c++?

1000


What is pair in c++?

1063


Explain the auto storage classes in c++.

1097


How const int *ourpointer differs from int const *ourpointer?

1122


What does n mean in c++?

1158


Explain linear search.

1051


Explain the different access specifiers for the class member in c++.

994


What is the extension of c++?

973


What is dynamic and static typing?

1180