can you explain me this question bcz i tried lot of time to understand and code this question but i didn’t understand
Question issuee , , , , , ,, , , , , , , , , , , , ,
@Nitin-Mishra-2380486738834604
hey as graph is unweighted you can solve it with bfs also,ap graph ko as tree visualise kro to suppose source node is root of tree aur apko destination pr jana hai so jo bhi uske neighbours hai src node ke use root ke children assume kro and queue me push kro with level =1+root->level aise hi ab har child ke lie krna hai and jha bhi apko destination node mile bs uska level return krdena hai kyunki yhi level shortest hoga or its a shortest path btwn src and destination.
ok but 3 1 …2 3… 2 es exp. me ek single edge dii hue h 2 or 3 and src. bhi 2 h toh apne ko kese pta chalega ki 1 disconnected h kyonki 2 k nbr. toh 3 hi h queue m toh usko hi add krwa skte h