All challenges
advancedData Structures & Algorithms~60 min

Shortest Path (Dijkstra)

Build Dijkstra's shortest-path algorithm from scratch on a weighted graph, the engine behind map routing and lowest-latency network paths. Across five steps you assemble a weighted graph, compute shortest distances with a heap-based priority queue, reconstruct the actual route, expose a clean distance query, and rank the nearest destination.