Dijkstra's algorithm
medium 22 minDijkstra's algorithm finds the shortest distance from one source to every node of a graph whose edge weights are non-negative.
Dijkstra with lazy deletion and path reconstruction
Read it, run it, change a line and run it again.
Loading editor…
Settle on pop, skip stale entries, store prev on every improvement. O((V + E) log V) time, O(V + E) space.