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 |
Can member data be public?
What are virtual functions and what is its use?
Why cstdlib is used in c++?
What is the meaning of string in c++?
What is the best ide for c++?
Can manipulators fall in love?
What are the operators in c++?
How the virtual functions maintain the call up?
What will happen if when say delete this ?
Why do we use structure in c++?
What does new in c++ do?
What are built-in functions? What is the syntax for the definition?