Computer Science EngineeringHard

The auxiliary space used by a recursive DFS on a graph with V vertices, in the worst case, is

  1. A. O(1)
  2. B. O(E)
  3. C. O(log V)
  4. D. O(V)

Correct answer: D. O(V)

The recursion stack can grow to V frames, for example along a path.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic