GATE | GATE-CS-2014-(Set-3) | Question 60
If G is a forest with n vertices and k connected components, how many edges does G have?
Explanation: Each component will have n/k vertices (pigeonhole principle). Hence, for each component there will be (n/k)-1 edges.
Since there are k components, total number of edges= k*((n/k)-1) = n-k.
Quiz of this Question
Attention reader! Don’t stop learning now. Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.
Learn all GATE CS concepts with Free Live Classes on our youtube channel.