Search:     Advanced search
Browse by category:
C/C++   |   Java   |   Oracle/Database   |   SAP   |   ASP .NET   |   Mainframe-DB2   |   Freshers

How many different trees can be constructed using n nodes?

Add comment
Views: 263
Votes: 0
Comments: 0

Its


2^n - n


So, if there are 10 nodes, you will have (1024 - 10) = 1014 different trees!! Confirm it yourself with a small number if you dont believe the formula.

 

 
Others in this Category
document 1.Can you construct a tree using postorder and preorder traversal?
document What purpose do the bitwise and, or, xor and the shift operators serve?
document How to reverse the bits in an interger?
document Q: What is 'LIKE' used for in WHERE clause? What are the wildcard characters?
document Check if the 20th bit of a 32 bit integer is on or off?
document Write a C program to count bits set in an integer?
document Q: 6. What do you accomplish by GROUP BY .... HAVING clause?
document A full N-ary tree has M non-leaf nodes, how many leaf nodes does it have?
document Q: What is the meaning of underscore ( ‘_’ ) in the LIKE statement?
document What is a threaded binary tree?
» More articles



RSS