for below input,but my dijkstra code shows wrong output for this input.
5 6
1 2 1
2 3 1
3 4 7
1 5 1
5 4 3
1 4 1
Enter source and destination
1 3
output = 101, should be 2
I found that my code isn't adding the new neighbor nodes in if block of dijkstra function sometimes.So, that's why some nodes are not updated. Why does this happen? I tried multiples times to find out the reason but failed.
My code — https://ideone.com/J7JNxy