Algorithms | Graph Shortest Paths | Question 11

Given a directed graph where weight of every edge is same, we can efficiently find shortest path from a given source to destination using?
(A) Breadth First Traversal
(B) Dijkstra’s Shortest Path Algorithm
(C) Neither Breadth First Traversal nor Dijkstra’s algorithm can be used
(D) Depth First Search

Answer: (A)

Explanation: With BFS, we first find explore vertices at one edge distance, then all vertices at 2 edge distance, and so on.

Quiz of this Question

GATE CS Corner    Company Wise Coding Practice

Recommended Posts:

0 Average Difficulty : 0/5.0
No votes yet.