Skip to content
GATEiit

GATE CSE 2024 Session 1 Q60: Connected components from the size of a DFS forest

Question

The number of edges present in the forest generated by the DFS traversal of an undirected graph GG with 100 vertices is 40. The number of connected components in GG is _________

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 60 (official GATE 2024 final answer key)

Concept used: A spanning forest with cc trees on nn vertices has n−cn - c edges.

First step: Solve 100−c=40100 - c = 40.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2024 Session 1 CS question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key