4,604 views
5 5 votes
Number of labeled binary trees are there on vertices {1,2,3,4} that have only vertex 1 as leaf and every binary trees has 4 nodes are _______.

2 Answers

Best answer
8 8 votes
We have $4$ nodes out of which $1$ is a leaf and there are no mode leaf nodes. So, we must have $4$ levels with one node in each. Each node in levels $2$, $3$ and $4$ have two choices- either to be left child or right child. So, totally $2 \times 2 \times 2 = 8$ ways. Now, $2,3,4$ can be permuted in any order in first $3$ levels and each permutation gives a different binary tree. So, total number of binary trees $= 8 \times 3! = 48$.
• selected by
1 1 vote

lets Vertex 1 is Leaf & it is fixed.
Exactly one leaf means at each level will be one & only one node..

Except root every node have 2 choices : 1. Left node 2. Right node
Total 4 nodes, so Number of possible combination for unlabeled tree are 2*2*2 = 8

We have to find Number of Labeled tree so multiply 8 by 3!
= 8*3! = 48

Position:
Show:

Related questions

1 1 vote
1 1 answer
2.8k
2.8k views
10 10 votes
1 1 answer
342
342 views
GO Classes asked Jul 28
342 views
A binary tree has:$1000$ nodes in the left subtree $100$ nodes in the right subtreeHow many nodes are processed before the root in preorder, inorder, and postorder traver...
7 7 votes
1 1 answer
207
207 views
GO Classes asked Jul 13
207 views
Which of the following functions correctly returns the total number of nodes in a binary tree rooted at $\texttt{t}$?int tree_size(TreeNode *t) { if (t == NULL) return 0;...
11 11 votes
1 1 answer
258
258 views
GO Classes asked Jul 11
258 views
Which of the following can be the number of nodes in a complete binary tree?$2$ $5$ $7$ $8$