Course Schedule (Detecting Cycles in a Graph) - Leetcode 207 - Graphs (Python)

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024

ความคิดเห็น • 11

  • @GregHogg
    @GregHogg  2 หลายเดือนก่อน +1

    Master Data Structures & Algorithms For FREE at AlgoMap.io!

  • @nikhilbhutani5277
    @nikhilbhutani5277 2 หลายเดือนก่อน +3

    I was able to solve it just by understanding the example portion of your video.Truly amazing explanation! Keep up the good work!

    • @GregHogg
      @GregHogg  2 หลายเดือนก่อน

      That's amazing!

  • @dannnyxz1511
    @dannnyxz1511 4 หลายเดือนก่อน +3

    Absolutely beautiful videos... All of them. They deliver understanding (and intuition) in the most concise, complete and elegant way, giving you tools to apply to other problems. I can't tell that other leetcode breakdowns on youtube deliver that. Thanks a lot!

  • @ItsEtoVito
    @ItsEtoVito หลายเดือนก่อน +1

    The same code works if you build the graphs adjacency list normally. So instead of generating the pair [0, 1] as 0 -> 1 you can also do 1 -> 0 (which makes more sense to me since to take class 0 you would first start at class 1). So in this case the line g[a].append(b) can be written g[b].append(a)

  • @0lange
    @0lange 2 หลายเดือนก่อน

    is the efficient the same when using an adjacency list here?

  • @verhaxity
    @verhaxity 5 หลายเดือนก่อน +1

    thanks

  • @user-jm6gp2qc8x
    @user-jm6gp2qc8x หลายเดือนก่อน +1

    whats with the all caps variable names lol

    • @GregHogg
      @GregHogg  หลายเดือนก่อน +1

      Constants are usually uppercase

    • @user-jm6gp2qc8x
      @user-jm6gp2qc8x หลายเดือนก่อน

      @@GregHogg noted sir!