if there is binary tree which one is the easiest way to
delete all child node?
Answer / 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 |
Is c++ vector a linked list?
What do you understand by a pure virtual member function?
What are the storage qualifiers?
What is the best c c++ compiler for windows?
Generally variables are stored in heap memory. When he variables are created in stack?
What is searching? Explain linear and binary search.
Which ide is best for c++?
When is the destructor called?
What are the advantages of using friend classes?
Is main a class in c++?
How does throwing and catching exceptions differ from using setjmp and longjmp?
When should I use unitbuf flag?