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 do you mean by stack unwinding in c++?

0 Answers  


How do you define a class in c++?

0 Answers  


How would you obtain segment and offset addresses from a far address of a memory location?

0 Answers  


What is type of 'this' pointer? Explain when it is get created?

0 Answers  


Tell me an example where stacks are useful?

0 Answers  


Difference between overloading vs. Overriding

0 Answers  


Is c++ the hardest language?

0 Answers  


Which programming language's unsatisfactory performance led to the discovery of c++?

0 Answers  


What do nonglobal variables default to a) auto b) register c) static

0 Answers  


Can member data be public?

0 Answers  


structure that describe a hotel with name, address,rooms and number of rooms

2 Answers  


Can you please explain the difference between overloading and overriding?

0 Answers  


Categories