Answer Posted / r.r.bharti
Simple way:
public int FindDepthOfTree(RBNode n)
{
if (n == null) return 0;
return Math.Max(FindDepthOfTree(n.LeftNode),
FindDepthOfTree(n.RightNode)) + 1;
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
What is the oops and benefits of oops programming?
How is class defined?
Templates mean
#include
What is the example of polymorphism?
How to call a non virtual function in the derived class by using base class pointer
What is abstraction in oop?
what type of question are asked in thoughtworks pair programming round ?
Why do we need oop?
Why multiple inheritance is not allowed?
What is the important feature of inheritance?
What is polymorphism explain?
is there any choice in opting subjects like 4 out of 7
What is super in oop?