GATE CS 2014, set 1 · Question 21 · Algorithms · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer
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?
- (A) Θ(n)
- (B) Θ(n+m)
- (C) Θ(n²)
- (D) Θ(m²)
Answer
Answer (C)
Answer from the official GATE CS 2014 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes