Graph -13: Check if Directed Graph has Cycle (Using DFS)

Поділитися
Вставка
  • Опубліковано 29 жов 2024

КОМЕНТАРІ • 41

  • @afridimajeed5897
    @afridimajeed5897 3 роки тому +1

    Literally the only video on this topic that makes sense.

  • @patrakarpopatlaltoofanexpr3258
    @patrakarpopatlaltoofanexpr3258 3 роки тому +1

    I waited 26 min, but in the end I can say its totally worth,
    Your examples in b/w helped a lot to get the crux,
    Wonderful explanation man,
    Thank you

    • @CodingSimplified
      @CodingSimplified  3 роки тому

      Thanks for your nice feedback. Keep watching our other videos as well.

  • @hemantsood9579
    @hemantsood9579 4 роки тому

    I think on the graph this is most valuable content on youtube . I have searched so many content on graph but i found this is the most valuable..

    • @CodingSimplified
      @CodingSimplified  4 роки тому

      Thanks Hemant for your nice feedback. Keep watching.

  • @adityahridyam7698
    @adityahridyam7698 3 роки тому +2

    Really after watching 2-3 videos. I got it from you. Thank you.

  • @therealltrader2346
    @therealltrader2346 3 роки тому

    your explanation helps me a lot i always find your video on youtube for any kind of coding problem

  • @siddheshnalawade6547
    @siddheshnalawade6547 3 роки тому +1

    This is pure gold. The best explanation on youtube.

  • @sufiyanshaikh1403
    @sufiyanshaikh1403 4 роки тому +2

    Sir better than gfg explanation 🙌🙌

  • @saunaknandi1814
    @saunaknandi1814 3 роки тому +1

    thank god i got a java tutorial again

  • @ClashWithSwap
    @ClashWithSwap 4 роки тому +1

    Nice explanation. I like this more than the previous bfs one. Which is more optimal though?

    • @CodingSimplified
      @CodingSimplified  4 роки тому +2

      Well. If you see overall Time complexity is same. O(V + E), but if bfs, indegree operation is extra, so it'll have extra operation cost as well It's taking extra space to store Indegree in HashMap.
      - So though Time complexity & space complexity both are linear in both approach, due to Indegree, bfs have more operation cost. Thanks.

  • @f3-faithfitnessfinance
    @f3-faithfitnessfinance 4 роки тому +2

    What do you do?
    You are working?

  • @sujithgoud3535
    @sujithgoud3535 4 роки тому +4

    The best explanation

  • @ShreyaSingh-vr9qi
    @ShreyaSingh-vr9qi 4 роки тому

    Will the BFS indegree method to detect cycle will work when there is self-edge loop ??

  • @kavithaskitchen6482
    @kavithaskitchen6482 2 роки тому

    Visited[index]=true;
    This one line code is not needed I feel.
    Rest code is good..
    Can you give me clarity for the mentioned code line code

  • @rohangaonkar8912
    @rohangaonkar8912 4 роки тому +2

    most elegent explanation

  • @coderbuddy3875
    @coderbuddy3875 4 роки тому +1

    Wonderful explanation I will give 5 star 👍👍

  • @manasvijain7458
    @manasvijain7458 3 роки тому

    I just have a small doubt why can't we use a similar approach to find a cycle in the Directed graph as we used for Undirected graph.

  • @utkarshpravind2275
    @utkarshpravind2275 4 роки тому

    can we used HashMap in place of recursive stack

  • @roliverma4483
    @roliverma4483 3 роки тому +1

    best explanation

  • @LALIT_TRIGUNAYAT_MUSIC
    @LALIT_TRIGUNAYAT_MUSIC 4 роки тому +2

    really a great explanation

  • @Impromptu21
    @Impromptu21 4 роки тому

    In ur example what if there is edge from 3 - 0 instead of 0-3 . I think it will not work

  • @ravirai5439
    @ravirai5439 4 роки тому

    is it possible to solve using only visited array?

    • @CodingSimplified
      @CodingSimplified  4 роки тому

      Visited array is just helper variable. You need to have DFS thing which is necessary here.

  • @PankajGupta-gh9cm
    @PankajGupta-gh9cm 4 роки тому

    how to edit multiple line in Eclipse

    • @CodingSimplified
      @CodingSimplified  4 роки тому +1

      Alt + shift + R is another way of refactoring, but I would suggest to search on google as per your specific request. Hope it helps you. Thanks.

  • @utkarshgangwar2173
    @utkarshgangwar2173 3 роки тому

    best explanation