Explain Dijkstra's Algorithm.

Explain Dijkstra's Algorithm.

Approach: Describe a greedy search for the shortest path in a weighted graph.

An algorithm for finding the shortest paths between nodes in a graph with non-negative edge weights. It maintains a set of visited nodes and a priority queue of distances to unvisited nodes, greedily selecting the minimum distance.

Follow-up: Why can it not handle negative edge weights?

Key concepts: priority queue, greedy, non-negative weights.