Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

dfs

GATE CSE & IT · Graph Algorithms · 1994-2026

10
PYQs
90%
keyed
1
elite explanations
9
years appeared

Study anchor

Cormen et al. — Introduction to Algorithms (CLRS)

Algorithms, data structures, graph algorithms, complexity

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2026 PYQ

Consider 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]$ are the discovery time and finishi...

mediumanswer keyelite explanation
2025 Q29

Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph G is/are TRUE?

mediumanswer key
2024 Q45

Let 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 first search (BFS) tree in G, rooted at v. W...

hardanswer key
2024 Q60

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

mediumanswer key
2021 PYQ

Consider a complete binary tree with 7 nodes. Let A denote the set of first 3 elements obtained by performing Breadth-First Search (BFS) starting from the root. Let B denote the se...

easybasic explanation
2014 PYQ

Let G be a graph with n vertices and m edges. What is the tightest upper bound on the running time of Depth First Search on G, when G is represented as an adjacency matrix?

easyanswer key
2006 PYQ

Consider the depth-first-search of an undirected graph with 3 vertices P, Q, and R. Let discovery time d(u) represent the time instant when the vertex u is first visited, and finis...

mediumanswer key
2004 PYQ

In a depth-first traversal of a graph G with n vertices,k edges are marked as tree edges. The number of connected components in G is

easyanswer key
2000 PYQ

Let G be an undirected graph. Consider a depth-first traversal of G, and let T be the resulting depth-first search tree. Let u be a vertex in G and let v be the first new (unvisite...

mediumanswer key
1994 PYQ

Which one of the following statements is false?

easyanswer key