42
http://en.wikipedia.org/wiki/Catalan_number
Chat with our AI personalities
For example (notation: root(left,right)):
A(-,B(-,C))
A(-,C(B,-))
B(A,C)
C(B(A,-),-)
C(A(-,B),-)
1..15 (not allowing empty trees).
As far as i Know, just one.Do you know any formula to calculate how many binary search trees are possible?--answer:(2n C n) / (n+1) = ( factorial (2n) / factorial (n) * factorial (2n - n) ) / ( n + 1 )where 'n' is number of element (integer/string)like:N Number of BST1 12 23 54 145 426 132and so on
If N>1, there are (2N-1) - (2N-1-1), otherwise, 1 nodes in the Nth level of a balanced binary tree.
A strictly binary tree is one where every node other than the leaves has exactly 2 child nodes. Such trees are also known as 2-trees or full binary trees. An extended binary tree is a tree that has been transformed into a full binary tree. This transformation is achieved by inserting special "external" nodes such that every "internal" node has exactly two children.
For a full binary tree of height 3 there are 4 leaf nodes. E.g., 1 root, 2 children and 4 grandchildren.