Shortest Path Algos Flashcards
1
Q
What is Dijkstra’s algorithm used for?
A
Finds shortest path in weighted graphs (O(V + E log V)).
2
Q
What is the Bellman-Ford algorithm, and how does it differ from Dijkstra’s?
A
Bellman-Ford works with negative weights.
3
Q
What is Floyd-Warshall used for?
A
Finds shortest paths between all nodes (O(n³)).