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 |
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
How would you stop a class from class from being derived or inherited?The constructer should not be Private,as object instantiation should be allowed.
What is the copy-and-swap idiom?
Is it possible for a member function to use delete this?
What is the output of the following 3D Array int arr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12}; what is the output for arr[2][1][0]?
6 Answers HCL, Integra, IPMC, ORG,
What are the two types of comments, and how do they differ?
What is the best way to take screenshots of a window with c++ in windows?
what is difference between static and non-static variables
Define a constructor?
Describe protected access specifiers?
What is the difference between "overloading" and "overridding"?
how many trys can we write in one class