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 the best c++ ide?

0 Answers  


Define stacks. Provide an example where they are useful.

0 Answers  


Define a conversion constructor?

0 Answers  


without if else statement can be written ah

0 Answers  


When do we use copy constructors?

0 Answers  


Why c++ is called oop?

0 Answers  


What is the best c++ book?

0 Answers  


What is vector string in c++?

0 Answers  


How would you find out if a linked-list is a cycle or not?

0 Answers  


Why would you use pointers in c++?

0 Answers  


What is type of 'this' pointer?

0 Answers  


What does ctime() do?

0 Answers  


Categories