1.
Which algorithm finds the shortest path from a single source in a weighted graph with non-negative edge weights?
A
Bellman-Ford
B
Floyd-Warshall
C
Dijkstra's algorithm
D
BFS
Answer and explanation
Correct Answer: C — Dijkstra's algorithm
Dijkstra's algorithm finds the shortest path from a single source in O((V + E) log V) for non-negative weights. Bellman-Ford handles negative weights but is slower.
