GATE CS 2025, set 2 · Question 29 · Algorithms · Multiple select (MSQ) · 1 mark · no negative marks

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

  1. (A) A DFS tree of G is a Shortest Path tree of G.
  2. (B) Every non-tree edge of G with respect to a DFS tree is a forward/back edge.
  3. (C) If (u, v) is a non-tree edge of G with respect to a BFS tree, then the distances from the source vertex s to u and v in the BFS tree are within ± 1 of each other.
  4. (D) Both BFS and DFS can be used to find the connected components of G.
Answer

Answer (B), (C), (D)

Answer from the official GATE CS 2025 answer key.

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