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 c strings syntax?
How do we balance an AVL Tree in C++?
What is the standard template library (stl)?
What is stack unwinding?
Why would you use pointers in c++?
What is namespace & why it is used in c++?
How many types of comments are there in c++?
what is static function
What are iterators in c++?
Is c++ the hardest language?
What is c++ try block?
What is null pointer and void pointer and what is their use?