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)).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Bellman-Ford algorithm, and how does it differ from Dijkstra’s?

A

Bellman-Ford works with negative weights.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Floyd-Warshall used for?

A

Finds shortest paths between all nodes (O(n³)).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly