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 |
What is constant in c++ with example?
Is c++ an integer?
Is there any problem with the following: char *a=NULL; char& p = *a;?
What are vtable and vptr?
Explain this pointer?
What do you mean by enumerated data type?
What is an explicit constructor?
What is the use of endl in c++?
How a modifier is similar to mutator?
What is the difference between interpreters and compilers?
What is the use of lambda in c++?
What is the outcome of cout< a) 16 b) 17 c) 16.5