what’s wrong with my code
Bfs shortest path problem
You have to increase the distance of adjacent nodes by 1 whereas you are increasing it by 6 in your code. Also, after adding s to the queue, you are marking visited[s] to be false whereas it should be true.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.