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 does iomanip mean in c++?

1131


Explain the use of vtable.

1029


What is the maximum combined length of command line arguments including the space between adjacent arguments?

956


How can I learn c++ easily?

1017


What is buffer and example?

941


What is a sequence in c++?

960


What is a map in c++?

1100


Do class declarations end with a semicolon?

1031


What is general form of pure virtual function? Explain?

942


What is the use of turbo c++?

1012


Which function cannot be overloaded c++?

1050


How do you show the declaration of a virtual constructor?

900


What are the differences between java and c++?

1005


What do you mean by overhead in c++?

1029


Comment on c++ standard exceptions?

1039