this is showing wrong ans on submission although it works for sample testcases…plz tell the reason and provide the corrected code…
Bfs shortest path
@S19LPPP0202
You don’t have to continue if node is already visited as you did in line 34. also before pushing node into queue, you have to whether (dis[x]>dis[cur]+1) is true or not. Also make intialise distance of each node to INT_MAX.
I have modified your code as per above changes please check it here.
i have asked other doubt as well…
this is link of doubt …
i have asked it seperately only …plz reply to this one as well…no one has responded for last 2 days…
yeah plz reply and then i will mark it as resolved…
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.
I have asked other doubts as well…plz resolve them as well.