Which of the following algorithms is used to find the shortest path in a graph…

2025

Which of the following algorithms is used to find the shortest path in a graph between a source vertex and all other vertices?

  1. A.

    Dijkstra's Algorithm

  2. B.

    Kruskal's Algorithm

  3. C.

    Prim's Algorithm

  4. D.

    None of the above

Attempted by 125 students.

Show answer & explanation

Correct answer: A

Dijkstra's Algorithm is used to find the shortest path in a graph from a source vertex to all other vertices.

Explore the full course: Coding For Placement