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 do you mean by stack unwinding in c++?
How do you define a class in c++?
How would you obtain segment and offset addresses from a far address of a memory location?
What is type of 'this' pointer? Explain when it is get created?
Tell me an example where stacks are useful?
Difference between overloading vs. Overriding
Is c++ the hardest language?
Which programming language's unsatisfactory performance led to the discovery of c++?
What do nonglobal variables default to a) auto b) register c) static
Can member data be public?
structure that describe a hotel with name, address,rooms and number of rooms
Can you please explain the difference between overloading and overriding?