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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are static and dynamic type checking?

1088


What are the comments in c++?

989


What are the advantages of c++? Explain

1064


Why c++ does not have finally?

1085


What is a terminating character in c++?

1395


Explain what are the sizes and ranges of the basic c++ data types?

1161


What do the keywords volatile and mean mutable?

1052


what is VOID?

1067


Why is swift so fast?

1129


Explain the concept of memory leak?

1115


What is class invariant in c++?

1235


Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL

812


Write a program using display() function which takes two arguments.

1080


How do you define/declare constants in c++?

1054


What is the disadvantage of using a macro?

1127