GATE CS 2026, set 2 · Question 37 · Algorithms · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

Let G be a weighted directed acyclic graph with m edges and n vertices. Given G and a source vertex s in G, which one of the following options gives the worst case time complexity of the fastest algorithm to find the lengths of shortest paths from s to all vertices that are reachable from s in G?

  1. (A) Θ(m + n)
  2. (B) Θ(m + n log(n))
  3. (C) Θ(nm)
  4. (D) Θ(n³)
Answer

Answer (A)

Answer from the official GATE CS 2026 answer key.

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