GATE DA 2026 · Question 40 · Programming, Data Structures and Algorithms · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

Consider a directed graph G = (V, E), where V is the finite set of vertices and E is the set of directed edges between the vertices. G may contain cycles but there is no self-loop. Further, G may not be strongly connected.
Let G^R be the graph obtained by reversing the directions of all the edges in G without changing the set of vertices.
Assume that Breadth First Search (BFS) or Depth First Search (DFS) from any given vertex v of a graph visits only the reachable vertices from v in that graph.
Which of the following statements must always be true, regardless of the structure of G?

  1. (A) If u is a reachable vertex in the BFS of G^R from v, then u is also a reachable vertex in the DFS of G from v.
  2. (B) In G^R, the BFS traversal from v will visit exactly the same set of vertices as the DFS from v in G.
  3. (C) The order of vertices visited in the BFS of G^R from v is the reverse of the order of vertices visited in the DFS of G from v.
  4. (D) If u is a reachable vertex in the DFS of G from v, then v is also a reachable vertex in the BFS of G^R from u.
Answer

Answer (D)

Answer from the official GATE DA 2026 answer key.

The step-by-step solution, where available, is part of GATE DA Pro. See what Pro includes