UGC-NET Dec 2013 · Trees

MCQ · 2 marks · Problem PROG-DSTR-0019

How many edges are there in a forest of t-trees containing a total of n vertices ?
  1. A
    n + t
  2. B
    n – t
  3. C
    n ∗ t
  4. D
    nt

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solution\[\boxed{\text{a tree with }n_i\text{ vertices has }n_i-1\text{ edges}}\]A forest of \(t\) trees with \(n_1+n_2+\cdots+n_t=n\) vertices has\[\sum_{i=1}^{t}(n_i-1)=n-t\ \text{edges}.\]Answer: B

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com