Dijkstra: Single Source Shortest Paths
Medium
Shortest Path Algorithms
Given a directed graph with non-negative edge weights and a source node, print the shortest distance from the source to every node, using -1 for unreachable nodes.
Constraints
1 <= n <= 10^5 0 <= m <= 2 * 10^5 0 <= w <= 10^9
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.