Snake and Ladder Problem (Graphs) | GeeksforGeeks

Sdílet
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! :)

Komentáře • 28

  • @kushalgupta9613
    @kushalgupta9613 Před 3 lety +31

    This is the first gfg video that really has a good explanation tbh

  • @gajendrapratapsingh4681
    @gajendrapratapsingh4681 Před 4 lety +13

    1. need to update visited[] every time.
    2. qentry a = new qentry(); should be declared before "if" condition.

    • @karana2260
      @karana2260 Před 3 lety

      better to add vertex inside if condition. i.e. shift q.add(a) inside if.

  • @AmanSingh-fl3wp
    @AmanSingh-fl3wp Před 4 lety +6

    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

  • @algorithmimplementer415
    @algorithmimplementer415 Před 4 lety +9

    Great explanation. Do you have some more videos done by you?

  • @chintalapativenkataramarahul

    Great explanation! Thanks!!

  • @ankursuri3853
    @ankursuri3853 Před 3 lety +1

    Thanks for the video. Good explanation.

  • @alokesh985
    @alokesh985 Před 2 lety +1

    Finally found a decent video explanation on the gfg CZcams channel!

  • @uditkumar867
    @uditkumar867 Před 4 lety +1

    Please show us the visualization of in terms of graph

  • @Guddukumar-mk3bz
    @Guddukumar-mk3bz Před 9 měsíci

    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.

  • @parasuraman8848
    @parasuraman8848 Před 4 lety +5

    Bro aren't we need to set the visited[j]=1 ?

  • @jaiprakashtoppo
    @jaiprakashtoppo Před 4 lety

    The elements of the array visited[ ] are not getting updated.

  • @krushnasharma9031
    @krushnasharma9031 Před 2 lety

    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

  • @aviraltandon1998
    @aviraltandon1998 Před rokem

    Great Explanation

  • @8750795655
    @8750795655 Před 3 lety

    Nice explanation

  • @sauravrana1432
    @sauravrana1432 Před rokem

    I find it difficult to understand why we are using BFS traversal and not DFS

  • @DeepakKumar-yc9hr
    @DeepakKumar-yc9hr Před 3 lety

    really is this code check minimum streps ?

  • @furizz284
    @furizz284 Před 3 lety +1

    Why can't we solve it using dfs ? can anyone pls explain that

  • @rahgurung
    @rahgurung Před 4 lety

    There is nothing called O(6), its just O(1) that you want to say.

  • @engineerscode1316
    @engineerscode1316 Před 4 lety

    bhai sound thik se dalta to jyada baria rehta

  • @prasannapm3220
    @prasannapm3220 Před 2 lety

    thank you pa

  • @siddhantthacker5244
    @siddhantthacker5244 Před 4 lety

    Its not working for me

    • @arijain6349
      @arijain6349 Před 3 lety

      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

    • @arijain6349
      @arijain6349 Před 3 lety

      this video is nothing more than a higher level of abstraction of how to implement this.

  • @karamveersingh8085
    @karamveersingh8085 Před rokem +2

    bhai sara whiteboard chupale koi dekh na le