Graph Interview Question - Course Schedule (Topological Sort)

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 พ.ย. 2020
  • Please like and subscribe! Comment any of your feedback down below. 😃
    Here's the explanation on how to solve popular Data Structure & Algorithms question on Leetcode, "Course Schedule". This is a classic question that we get from technical interviews at Google, Facebook, Amazon, Microsoft, and so on. Let’s try this question to learn more about topological sorting, kahn’s algorithm, graph traversal and graph pruning.
    Comment down any questions below! Please give it a like and subscribe to support our channel.
    #interview #graph #topologicalsort #job #google #amazon #facebook #faang #topological #algorithm #sort #data_structures #recursive #leetcode
    Facebook: / potatocoders
    Linkedin: / potato-coders
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @ppsor329
    @ppsor329 ปีที่แล้ว

    Beautiful demonstration with clear mind

  • @markomekjavic
    @markomekjavic 2 ปีที่แล้ว

    Really love your explanation and your simplistic code! This is by far the best video content on the topic I've seen so far, many thanks!

  • @keenheat3335
    @keenheat3335 3 ปีที่แล้ว +2

    topological sorting is surprisingly useful in warehouse logistic and manufacturing as well. Component manufacturing process and item stacking can be represent as an acyclic directed graph

  • @alexbarganier7289
    @alexbarganier7289 3 ปีที่แล้ว +2

    Great explanation, I especially liked how you changed your solution from returning a boolean to the actual topological sort order with just 3 small changes.

    • @potatocoders2028
      @potatocoders2028  3 ปีที่แล้ว

      Made our day, thanks 😀 please feel free to give recommendation for any other content that you would like us to cover

    • @alexbarganier7289
      @alexbarganier7289 3 ปีที่แล้ว

      @@potatocoders2028 How about quick select algorithm to solve the problem of "Find the K most frequent elements in an array". The min heap O(NlogK) solution is pretty intuitive, but quick select is optimal (and also much trickier to understand!). Thanks for the content.

    • @potatocoders2028
      @potatocoders2028  3 ปีที่แล้ว +1

      Yes we will definitely try to cover this! Thanks for suggesting the content idea.

  • @samantha9460
    @samantha9460 2 ปีที่แล้ว

    Good job, your explanation made a lot of sense! I tried watching or reading other solutions, they were all confusing to me.

  • @sofoboachie5221
    @sofoboachie5221 3 ปีที่แล้ว +1

    My God what a voice! You earned a sub

    • @potatocoders2028
      @potatocoders2028  3 ปีที่แล้ว

      Thank you! Happy to hear that you enjoyed the video