we all know, the tree is also an acyclic graph.
so we can simply apply the concept:
SUM OF DEGREE OF ALL THE VERTICES = 2 X (TOTAL NUMBER OF EDGES)
in the question, it is given that,
nodes with degree 1 == 4 (that means there are 4 nodes having 1 child, i.e degree = 1+1 = 2)
nodes with degree 2 == 3(that means there are 3 nodes having 2 child, i.e degree = 2+1 = 3)
nodes with degree 3 == 3(that means there are 2 nodes having 3 children (so degree == 3 + 1 = 4) and 1 root node with degree 3(number of children and because ternary and root has no parent--> degree == 3 + 0 = 3) )
Let,
number of leafs nodes = L
and degree of all leafs node is 1 because it is attached with its parent i.e one edge
total nodes in tree = internal nodes + leafs node = 4 + 3 + 3 + L = 10 + L
so, total number of edges in tree = (total nodes - 1) = (10 + L) -1 = 9 + L
SUM OF DEGREE OF ALL THE VERTICES = 2 X (TOTAL NUMBER OF EDGES)
(1(root) X 3) + ( 2 X 4 ) + (3 X 3) + (4 X 2) + ( L X 1) = 2 X [ 9 + L ]
=> 3 + 8 + 9 + 8 + L = 18 + 2L
=> 28 + L = 18 + 2L
=> L = 10
s0 answer (D)