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 |
Difference between pointer to constant and constant pointer to a constant. Give example.
What is the output of: String a1 = "Hello"; String a2 = "world!"; String* s1 = &a2; String& s2 = a1; s1 = &a1; s2 = a2; std::cout << *s1 << " " << s2 << std::endl;
Write a C/C++ program to show the result of a stored procedure "PROC_RESET_MAIL" on database "USER_NOTIFY".
2 Answers ABC, Accenture, DataLand, HCL, Webyog,
What do you mean by function overriding & function overloading in c++?
Explain what is oop?
Is swift better than c++?
What are function poinetrs? where are they used?
What is the difference between a shallow copy and a deep copy?
Define pure virtual function?
Explain selection sorting?
difference between macro and function?
How to write Multithreaded applications using C++?
2 Answers Honeywell, TCS, Wipro,