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 to swap two numbers with out using temp variable
12 Answers Global eProcure, TCS,
What is array in c++ pdf?
Explain polymorphism?
What is a .h file c++?
give me an example for testing a program showing the test path .show how the test is important and complex.
Can we overload operator in c++?
Is c++ a pure oop language?
What is the output of printf("%d")?
58 Answers CTS, HCL, Infosys, TCS, Winit, Wipro,
Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?
How can you specify a class in C++?
What is the insertion operator and what does it do?
Can you write a function similar to printf()?