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 does iomanip mean in c++?
Explain the use of vtable.
What is the maximum combined length of command line arguments including the space between adjacent arguments?
How can I learn c++ easily?
What is buffer and example?
What is a sequence in c++?
What is a map in c++?
Do class declarations end with a semicolon?
What is general form of pure virtual function? Explain?
What is the use of turbo c++?
Which function cannot be overloaded c++?
How do you show the declaration of a virtual constructor?
What are the differences between java and c++?
What do you mean by overhead in c++?
Comment on c++ standard exceptions?