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?



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

Answer / 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

More C++ General Interview Questions

Is c++ vector a linked list?

0 Answers  


What do you understand by a pure virtual member function?

0 Answers  


What are the storage qualifiers?

0 Answers  


What is the best c c++ compiler for windows?

0 Answers  


Generally variables are stored in heap memory. When he variables are created in stack?

4 Answers   Persistent,


What is searching? Explain linear and binary search.

0 Answers  


Which ide is best for c++?

0 Answers  


When is the destructor called?

0 Answers  


What are the advantages of using friend classes?

0 Answers  


Is main a class in c++?

0 Answers  


How does throwing and catching exceptions differ from using setjmp and longjmp?

1 Answers  


When should I use unitbuf flag?

0 Answers  


Categories