Snake and Ladder Problem (Graphs) | GeeksforGeeks
Vložit
- čas přidán 22. 09. 2019
- Find Complete Code at GeeksforGeeks Article: www.geeksforgeeks.org/snake-l...
This video is contributed by Anik Shah.
Please Like, Comment and Share the Video among your friends.
Install our Android App:
play.google.com/store/apps/de...
If you wish, translate into local language and help us reach millions of other geeks:
czcams.com/users/timedtext_cs_p...
Follow us on Facebook:
/ gfgvideos
And Twitter:
/ gfgvideos
Also, Subscribe if you haven't already! :)
This is the first gfg video that really has a good explanation tbh
1. need to update visited[] every time.
2. qentry a = new qentry(); should be declared before "if" condition.
better to add vertex inside if condition. i.e. shift q.add(a) inside if.
I guess in the for loop at last after adding the vertex to the queue you need to set the vertex as visited as well
Great explanation. Do you have some more videos done by you?
Great explanation! Thanks!!
Thanks for the video. Good explanation.
Finally found a decent video explanation on the gfg CZcams channel!
Please show us the visualization of in terms of graph
I m a big fan of geeksforgeeks,it helps me alot in project and learning c. thanku a lot for this. When i saw, there is a CZcams channel for geeksforgeeks. I became very happy. I mean amazing.
Bro aren't we need to set the visited[j]=1 ?
The elements of the array visited[ ] are not getting updated.
How do we handle moving to the left in a row. Let's say we are at location 7. The for loop will never run as i+1 will be out of bounds
Great Explanation
Nice explanation
I find it difficult to understand why we are using BFS traversal and not DFS
really is this code check minimum streps ?
yeah this won't give you minimum no of steps required.
Why can't we solve it using dfs ? can anyone pls explain that
you can.
Because it is a graph not tree.
We can calculate distance by dfs in case of tree.
There is nothing called O(6), its just O(1) that you want to say.
bhai sound thik se dalta to jyada baria rehta
thank you pa
Its not working for me
depending on how ur input is formatted it won't work. if you get a matrix this won't work, you need to calculate what the position "35", or "15" actually represents in terms of rows and columns and implement it that way
this video is nothing more than a higher level of abstraction of how to implement this.
bhai sara whiteboard chupale koi dekh na le