Please help me in this code ::: i applied bfs on weighted graph but getting struck please help

@kailash_01 hey what is the problem you are facing and in what concept?

i just applied bfs on weighted graph and want to print the node but getting wrong answer

@kailash_01 hey I have applied correct logic ,please check it:

@kailash_01 hey I have corrected your logic please check:

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.