edited by
1,991 views
1 1 vote
four vertices {A,B,C,D} is given which has only vertex D as a leaf total number of binary tree are possible when every binary tree has four node!

2 Answers

0 0 votes

Its mentioned that node D will always be leaf node and tree has always 1 leaf node also. Hence we are left with 3 nodes.

At 1st level we can have 3C1 choices to select node

At 2nd level we have 2 nodes left so we can select 2C1  *2   as either we can put the node at right or left

at 3rd we have 1 node left and we can place it at either left or right so 2 

at left D can be also placed at right or left so 2

so 3C1 * 2C1 *2  *2 *2   = 48 BT

Position:
Show:

Related questions

0 0 votes
0 0 answers
740
740 views
sunaina rawat asked Nov 7, 2017
740 views
Consider programint foo(struct node *tree){if(tree==0)return 0;int lh=ht(tree->left);int rh=ht(tree->right);int ld=foo(tree->left);int rd=foo(tree->right);return max(lh+r...
0 0 votes
1 1 answer
631
631 views
0 0 votes
1 1 answer
1.1k
1.1k views
0 0 votes
2 2 answers
1.2k
1.2k views