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

Can member data be public?

0 Answers  


What are virtual functions and what is its use?

1 Answers  


Why cstdlib is used in c++?

0 Answers  


What is the meaning of string in c++?

0 Answers  


What is the best ide for c++?

0 Answers  


Can manipulators fall in love?

0 Answers  


What are the operators in c++?

0 Answers  


How the virtual functions maintain the call up?

0 Answers  


What will happen if when say delete this ?

7 Answers  


Why do we use structure in c++?

0 Answers  


What does new in c++ do?

0 Answers  


What are built-in functions? What is the syntax for the definition?

0 Answers  


Categories