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

What is constant in c++ with example?

0 Answers  


Is c++ an integer?

0 Answers  


Is there any problem with the following: char *a=NULL; char& p = *a;?

1 Answers  


What are vtable and vptr?

0 Answers  


Explain this pointer?

0 Answers  


What do you mean by enumerated data type?

0 Answers  


What is an explicit constructor?

1 Answers  


What is the use of endl in c++?

0 Answers  


How a modifier is similar to mutator?

0 Answers  


What is the difference between interpreters and compilers?

0 Answers  


What is the use of lambda in c++?

0 Answers  


What is the outcome of cout< a) 16 b) 17 c) 16.5

0 Answers  


Categories