246 views
1 votes
1 votes
We are given a set of n distinct elements and an unlabelled binary tree with n nodes.how many ways can we populate the tree with the given set so that it becomes a BST

0

1

n!

2nCn / (n+1)

1 Answer

4 votes
4 votes
Inorder Travesal of BST is unique so you can have only one arrangement which gives you that order.so there is only one way you can populate the tree.

Related questions

0 votes
0 votes
1 answer
1
3 votes
3 votes
5 answers
3
srestha asked May 22, 2019
1,795 views
Consider the following function height, to which pointer to the root node of a binary tree shown below is passedNote that max(a,b) defined by #define max(a,b) (a>b)?a:b.i...
0 votes
0 votes
1 answer
4