in DS recategorized by
2,961 views
5 votes
5 votes

The number of structurally different possible binary trees with $4$ nodes is 

  1. $14$
  2. $12$
  3. $336$
  4. $168$
in DS recategorized by
by
3.0k views

4 Comments

here strucally differents means not laballed ?

i ticked 336 :( some one verify
0
0
14

pls verify
3
3

it should be 14,

no. of structurally different binary binary trees $\equiv$ no. of different unlabeled trees = nth catalan no.

5
5

it should be 14 as no of structurally different binary trees could be derived through catalan's number.

https://en.wikipedia.org/wiki/Catalan_number

3
3

2 Answers

12 votes
12 votes
Best answer
  • structurally different  trees = Unlabeled trees 
  • Number of Unlabeled binary trees = (2n)!/(n+1)!n!  [Catalan Number]
    • Here n =4
    • answer = 8!/(5! 4!) =14
selected by
by
1 vote
1 vote
No of unlabelled binary trees on n nodes = $\frac{_{n}^{2n}\textrm{C}}{n+1}$

No of labelled binary trees on n nodes = $\left ( \frac{_{n}^{2n}\textrm{C}}{n+1} \right )*n!$

Structurally different = unlabelled = $\frac{_{4}^{8}\textrm{C}}{5}$ = $14$
Answer: