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 |
How do I start a c++ project?
What is the difference between an external iterator and an internal iterator?
How much is c++ certification?
What is a class definition?
What is lvalue?
Give example of a pure virtual function in c++?
Tell me an example where stacks are useful?
What is meant by entry controlled loop? What all C++ loops are exit controlled?
What are the basic data types used in c++?
Can malloc be used in c++?
Explain data encapsulation?
WHO DEVELOPED C++?