Algorithm Designex06e2_shortest

Shortest Path with Negative Edge

d6403127-ae2d-450b-ad99-273a4cc36310.cppC++
1// Loading code...

Selected Submission

100 / 100
0.001s
1476 KB
Shortest PathGraph
Time Comp.
O(V*E)
Space Comp.
O(V)
Readability
6/10

"The code implements a single-source shortest path algorithm, specifically the Bellman-Ford algorithm, to find the minimum distances from a source node to all other nodes in a graph. The negative cycle detection is also present, indicated by the 'change' variable."

History

AttemptPoints Time
Try #61005/1/2025
Try #51005/1/2025
Try #405/1/2025
Try #31004/1/2025
Try #21004/1/2025
Try #11004/1/2025