GATE CS 2000 · Shortest Path Algorithms

MCQ · 1 mark · Problem PROG-GRPH-0121

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 (unvisited) vertex visited after visiting u in the traversal. Which of the following statement is always true?
  1. A
    u, v must be an edge in G, and u is a descendant of v in T
  2. B
    u, v must be an edge in G, and v is a descendant of u in T
  3. C
    If u, v is not an edge in G then u is a leaf in T
  4. D
    If u, v is not an edge in G then u and v must have the same parent in T

Solve it on GATE DA practice →More Graph Theory & Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option C.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/4208/gate2000-2-19

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com