Which algorithm is used to find the shortest path in a graph with non-negative edge weights?
- Bellman-Ford
- Dijkstra
- Floyd-Warshall
- Kruskal
Answer: Dijkstra
Dijkstra's algorithm finds shortest paths from a source node to all others in graphs with non-negative weights using a priority queue (O((V+E)log V)). Bellman-Ford handles negative weights; Floyd-Warshall finds all-pairs shortest paths; Kruskal is for minimum spanning tree. Classic graph algorithm for technical exams.