๐ฎ Shortest Path (Practice)
Companion to the Shortest Path Algorithms guide. Implement Dijkstra with a min-heap on a weighted graph. Edit and run the code right here โ it executes in your browser.
๐ Your turnโ
Loading editorโฆ
๐ง Challenge yourselfโ
- Reconstruct the actual path, not just distances.
- Why does Dijkstra fail with negative edges? (try Bellman-Ford)
- Add a heuristic to turn this into A*.
Continue the learning path โ Union Find