21. Shortest Path in Undirected Graph
Note: Sorry for uploading late; my exam is going on.
Problem Description
n = 9, m = 10
edges = [[0,1],[0,3],[3,4],[4,5],[5,6],[1,2],[2,6],[6,7],[7,8],[6,8]]
src = 00 1 2 1 2 3 3 4 4n = 4, m = 2
edges = [[1,3],[3,0]]
src = 31 1 -1 0Constraints:
My Approach
Time and Auxiliary Space Complexity
Code (C++)
Code (Java)
Code (Python)
Contribution and Support
📍Visitor Count
Last updated