in DS edited by
31,608 views
29 votes
29 votes

The maximum number of binary trees that can be formed with three unlabeled nodes is:

  1. $1$
  2. $5$
  3. $4$
  4. $3$
in DS edited by
31.6k views

2 Comments

For unlabelled tree
   T(n) = (2n)! / (n+1)!n!
Number of Labeled Tees = (Number of unlabeled trees) * n!
                       = [(2n)! / (n+1)!n!]  × n!

Useful read

https://www.geeksforgeeks.org/enumeration-of-binary-trees/

7
7
$\#\ of\ unlabelled\ binary\ trees\ for\ n-nodes$ $= \dfrac{^{2n}C_{n}}{n+1}$$=$$\dfrac{(2n)!}{(n+1)!\ n!}$

$\#\ of\ labelled\ binary\ trees\ for\ n-nodes$ $=n!$ $\left \{ \#\ of\ unlabelled\ binary\ tree \right \}$
7
7

3 Answers

33 votes
33 votes
Best answer

Can be found with formula... $(2nCn/n+1)$... $n$ being the number of nodes. for the given question... where $n=3$... answer is $5$. Let me also specify here.. that number of Binary Search Trees with $n$ nodes is equal to number of unlabeled Binary trees.

http://gatecse.in/wiki/Number_of_Binary_trees_possible_with_n_nodes

Correct Answer: $B$

edited by

4 Comments

yes, in case of BST the nodes can have only one arrangement, i.e sorted order
6
6
In Unlabeled tree's only structure matters, what's value in node that does not matter.
1. o      2.    o       3.   o      4.    o   5.    o
      \               \           / \           /          /
       o               o       o   o      o          o  
      /                   \                  /              \
   o                      o              o                 o
With three unlabeled node, there are 5 trees. If they were labeled, then each strucure can be filled with 3! ways.
26
26
Yes it's okay to do it with formula but we can also do this by using permutation and combination and just by visualising and analysing as numbe of node is 3. it willbe 5.
0
0
0 votes
0 votes
There are 5 binary trees maximum
0 votes
0 votes
Answer is 5.

By using 2ncn/(n+1) used for finding the number of unlabelled trees.
Answer:

Related questions