please help me out in the code.I am trying to implement djikstra algorithm but dont know why the solution is not being accepted?
Problem in djikstra algorithm code
hello @TusHar-AroRa-2294450460870717

this will print distances only for those vertices that are directly / indirectly connected with source node.
to print for all vertices.
iterate from i= 1 to no of vertices.
check if i is present there in dist or not ,if not present then print -1 otherwise do what u were doing in above code
your code is correct.
just print output for each test case in separate line.
Thank you…Got the right answer