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

How do you define a class in c++?

1037


Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?

1021


What is c++ vb?

1035


Refer to a name of class or function that is defined within a namespace?

1060


What is prototype for that c string function?

1086


What is token c++?

991


What is the main purpose of c++?

1022


Why are pointers used?

952


Explain the static member function.

1124


Why do we use classes in programming?

995


what you know about c++?

1099


How can you quickly find the number of elements stored in a dynamic array?

998


What are static member functions?

1054


What is a manipulator in c++?

1180


How const int *ourpointer differs from int const *ourpointer?

1076