Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 is overloading in oops?

1170


What is the use of oops?

1066


What are constructors in oop?

1195


What is meant by oops concept?

1048


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

3536


What is polymorphism and example?

1058


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

2075


How do you explain polymorphism?

1082


What are the components of marker interface?

1067


What is polymorphism give a real life example?

1039


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

2379


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1641


Can an interface inherit a class?

1069


What are classes oop?

1041


which feature are not hold visual basic of oop?

2196