Clone Graph - Leetcode 133 - Graphs (Python)

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 16

  • @GregHogg
    @GregHogg  4 месяца назад +1

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

  • @printhaider
    @printhaider Месяц назад

    I'm going to be honest, I really love your explanations. You do it best! Everytime I have any problem trying to understand any blind 75 or the 150 list problem I always search "[input problem] Greg Hogg". I hope you keep it up and I look forward to learning more from your future videos!

  • @geetarjohn
    @geetarjohn 2 месяца назад

    Thanks, this was very helpful. I paused after you described the approach and then implemented my own version of the solution based on your strategy.
    My differences were:
    1. Using recursive DFS to save on a stack.
    2. I doubled the use of my old-to-new mapping dict as a visited set. Because the keys to the dict have to be unique anyway. Not sure that significantly improves efficiency or anything but it did work.

  • @SHIHJUIheh
    @SHIHJUIheh 3 месяца назад

    Thank you for providing such a great explanation. This is the most clearest explanation I 've seen on the entire internet. Not only did you provide the solution, but you also explained the underlying concepts!

    • @GregHogg
      @GregHogg  3 месяца назад

      Glad to hear it ☺️☺️

  • @anujsharma9595
    @anujsharma9595 6 месяцев назад +1

    I like your way of teaching bro Comment from India

    • @GregHogg
      @GregHogg  6 месяцев назад +4

      Thank you so much! Reply from Toronto :)

  • @christianjt7018
    @christianjt7018 3 месяца назад

    the explanation was really clear, thanks!

    • @GregHogg
      @GregHogg  3 месяца назад +1

      You're flying through this!!

    • @christianjt7018
      @christianjt7018 3 месяца назад

      @@GregHogg thanks Greg, your videos are very well explained, I have learned a lot

    • @GregHogg
      @GregHogg  3 месяца назад

      @@christianjt7018 that's amazing 🤩🤩

  • @GarouNguyen
    @GarouNguyen 4 месяца назад

    hash_map[node] = Node(val=node.val) why it has the rigth to access neighbours atteibute? Why just not Node() bro can you explain, I don't understand

  • @keltoro
    @keltoro 5 месяцев назад

    Isn't it better to use DFS here instead?

    • @anthonygong100
      @anthonygong100 3 месяца назад

      He is using DFS, there's just two passes instead of one

  • @souvickmaity4867
    @souvickmaity4867 6 месяцев назад

    I also reply from India

  • @UrsKarthikHere
    @UrsKarthikHere 4 месяца назад

    Indian