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
How do you define a class in c++?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?
What is c++ vb?
Refer to a name of class or function that is defined within a namespace?
What is prototype for that c string function?
What is token c++?
What is the main purpose of c++?
Why are pointers used?
Explain the static member function.
Why do we use classes in programming?
what you know about c++?
How can you quickly find the number of elements stored in a dynamic array?
What are static member functions?
What is a manipulator in c++?
How const int *ourpointer differs from int const *ourpointer?