Write a program to get the binary tree.

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


Please Help Members By Posting Answers For Below Questions

what type of questions

1902


What is object in oop?

887


How many human genes are polymorphic?

802


What is abstract class in oops?

782


Can private class be inherited?

915


program for insertion ,deletion,sorting in double link list

2450


What is the full form of oops?

925


What is abstraction in oop with example?

866


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2221


Write a program to sort the number with different sorts in one program ??

2112


What is a class and object?

804


What does sksksk mean in text slang?

1849


Why is polymorphism needed?

800


which feature are not hold visual basic of oop?

1951


What is the point of oop?

874