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 the best c++ ide?
Define stacks. Provide an example where they are useful.
Define a conversion constructor?
without if else statement can be written ah
When do we use copy constructors?
Why c++ is called oop?
What is the best c++ book?
What is vector string in c++?
How would you find out if a linked-list is a cycle or not?
Why would you use pointers in c++?
What is type of 'this' pointer?
What does ctime() do?