GATE CS 2014 · Set-1 · Graph Traversals (BFS & DFS)

MCQ · 1 mark · Problem PROG-GRPH-0081

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?
  1. A
    \(\Theta (n)\)
  2. B
    \(\Theta (n+m)\)
  3. C
    \(\Theta (n^{2})\)
  4. D
    \(\Theta (m^{2})\)

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/1771/gate2014-1-11

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