GATE 2014 CS (CS3) – Question 61
A forest G has n vertices and k connected components. How many edges does it have?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) $n-k$
Explanation
Each connected component of a forest is a tree. A component with n_ivertices has n_i−1edges; summing over kcomponents givesΣn_i−k=**n−k,C**. Isolated vertices satisfy the same formula with zero edges.