Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE-CS-2014-(Set-3) | Question 60

  • Last Updated : 28 Jun, 2021

If G is a forest with n vertices and k connected components, how many edges does G have?
(A) floor(n/k)
(B) ceil(n/k)
(C) n-k
(D) n-k+1

Answer: (C)

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.

My Personal Notes arrow_drop_up
Recommended Articles
Page :