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
Differentiate between the manipulator and setf( ) function?
What is a static element?
What is the most useful programming language?
What do you mean by inheritance in c++?
What is std namespace in c++?
Write a note about the virtual member function?
I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?
What is meant by entry controlled loop? What all C++ loops are exit controlled?
What is the full form of ios?
Explain function overloading
Define the process of handling in case of destructor failure?
What is the use of "new" operator?
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
What do you mean by public protected and private in c++?
Write a Program to find the largest of 4 no using macros.