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 ________.
GATE CS 2024 (Forenoon) — Question 60
AlgorithmsGraph Traversals (BFS, DFS) & Single-Source Shortest PathsNAT2 marksMedium
A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.
More on Graph Traversals (BFS, DFS) & Single-Source Shortest Paths
- GATE CS 2026 (Forenoon) · Q41Let G(V, E) be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that…
- GATE CS 2026 (Forenoon) · Q50Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph G(V, E) as input, where d[v] and f[v]…
- GATE CS 2026 (Afternoon) · Q37Let G be a weighted directed acyclic graph with m edges and n vertices. Given G and a source vertex s in G , which one of the following opt…
- GATE CS 2025 (Afternoon) · Q29Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph G is/are…
- GATE CS 2025 (Afternoon) · Q59Consider the following algorithm someAlgo that takes an undirected graph G as input. someAlgo(G) 1. Let v be any vertex in G . Run BFS on G…
- GATE CS 2024 (Forenoon) · Q45Let G be a directed graph and T a depth first search (DFS) spanning tree in G that is rooted at a vertex v . Suppose T is also a breadth fi…

