in DS
739 views
6 votes
6 votes
What is the number of binary trees with 4 nodes which when traversed in pre-order gives the sequence 1,2,3,4?
in DS
by
739 views

4 Comments

Because it's binary tree not binary search tree :)
2
2
yes
thanks all
1
1

@  @    I think the answer be 6 since the question has mentioned about the preorder traversal  ?

0
0

1 Answer

0 votes
0 votes
$(2n)!/(n+1)!*n!$

where n= no. of nodes

 In this case $(8)!/(4+1)!*4!$ = 14