Single source shortest path

code is not working.
Please explain the problem

@Divyakharb its working fine whats the problem?

This is the outputdist of node 0 from src is 0 dist of node 1 from src is 1 dist of node 2 from src is 2 dist of node 3 from src is 3 dist of node 4 from src is 4 dist of node 5 from src is 5

@Divyakharb according to ur code graph made by u is 0-1-2-3-4-5 and thats the output
the code is fine node is diplayed every time

shortest distance from source displayed is wrong ,it should be 0,1,2,1,2,3 besides 0,1,2,3,4,5

@Divyakharb have you sent the correct code ??
because in the one you have sent you are displaying the graph using bfs , i dont see dist anywhere