Question
The number of edges present in the forest generated by the DFS traversal of an undirected graph with 100 vertices is 40. The number of connected components in is _________
Official answer and solution
- Official answer
- 60
- From
- Official GATE 2024 answer key
Solution
Use the forest relation , where is the number of vertices and is the number of connected components (trees in the DFS forest).
A DFS traversal of an undirected graph with vertices and connected components produces a spanning forest consisting of trees and tree edges. Given and :
60
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2024 Computer Science and Information Technology - Set 1 (CS1)
- Question
- 60 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.