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
What are the various storage classes in C++?
What is operator overloading in c++ example?
What is a manipulative person?
What are put and get pointers?
Differences between private, protected and public and give examples.
Can a function take variable length arguments, if yes, how?
What is conditions when using boolean operators?
Discussion on error handling of C++ .
What is a float in c++?
What are the various operations performed on stack?
What is an inline function in c++?
Does c++ have arraylist?
Can we use struct in c++?
What does iomanip mean in c++?
What is the basic concept of c++?