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 is a stack c++?
What is heap sort in c++?
Why is c++ still best?
What methods can be overridden in java?
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
If you don’t declare a return value, what type of return value is assumed?
Can you pass an array to a function in c++?
What is pair in c++?
Explain the auto storage classes in c++.
How const int *ourpointer differs from int const *ourpointer?
What does n mean in c++?
Explain linear search.
Explain the different access specifiers for the class member in c++.
What is the extension of c++?
What is dynamic and static typing?