Topological sort in 5 minutes - Inside code

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

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

  • @insidecode
    @insidecode  Год назад +2

    Discover the new graph theory algorithms course: inscod.com/graphalgo
    🔴
    / \
    🔵-🔴
    | |
    🔴-🔵

    • @danc6673
      @danc6673 Год назад

      Long time follower, I was one of the first to buy the course when it became available, but overall the course felt very lacking in content when compared to the previous courses
      I was expecting more problems overall. In fact, the course only had 1 problem on topological sort. It would've been great if you covered classic graph problems in the course, such as Alien Dictionary and Longest Increasing Path in a Matrix

  • @Shadic35
    @Shadic35 3 года назад +16

    Honestly, this video makes it so much easier to understand. I have interviews coming up and need quick refreshers. Thank you for making short and simple tutorials :)

  • @kwamenani7775
    @kwamenani7775 2 года назад

    Honestly your channel is one of my top 3 go to whenever i face challenges understanding DSA concepts

  • @tmanley1985
    @tmanley1985 3 года назад +1

    This channel is criminally underrated.

    • @insidecode
      @insidecode  3 года назад

      Thanks for your comment!

  • @aryan7069_
    @aryan7069_ 3 года назад +1

    i have not started graphs yet. Still understood your video. Thanks :)
    this is a great video
    i have watched your most videos before even implementing that DS like tree etc. This gave me excitement and interest to study that DS . I then study it and revise whatever you teach in your videos :)

  • @TheBurrito171
    @TheBurrito171 7 месяцев назад

    Thank you so much, I was so lost with my book. Cleared right up

  • @harrisoncamm1054
    @harrisoncamm1054 2 года назад

    Best explanation of topological sort on youtube!

  • @gardcola7946
    @gardcola7946 Год назад

    just became a genius, i am gonna nail this examn thanks

  • @modetechno7728
    @modetechno7728 11 месяцев назад +1

    is this using depth first? And are there multiple correct sequences?

  • @peterfarrell66
    @peterfarrell66 Год назад

    Clever example of a situation leading to a graph! 😅

  • @uwspstar2008
    @uwspstar2008 3 года назад +1

    love your post, thanks for sharing!

  • @alejomarchanr
    @alejomarchanr 3 года назад +1

    A wonderful video, something I had been looking for a long time. I have processes that have precedence and dependencies but I only have the first level up and down. Is there an idea to integrate each grandfather, father, son, grandson, great-grandson of each process? Any recommendation to graph these nodes or to obtain an image of the path of each process?

    • @insidecode
      @insidecode  3 года назад

      I think that you should use bfs to get descendants, and for ancestors, you can also use bfs but in the complement graph, basically we get the complement graph by reversing all the edges

  • @anacsgo
    @anacsgo 23 дня назад

    thank you!!!

  • @jasonzhang1133
    @jasonzhang1133 2 года назад

    Very good video, as always. Thank you so much!

  • @JenilCalcuttawala
    @JenilCalcuttawala 3 года назад

    Very well explained..! What are the practical usecases of the topological sort?

    • @insidecode
      @insidecode  3 года назад +1

      It can be used for example in projet management when there are tasks that have to be done because some other ones

  • @colbylithyouvong5478
    @colbylithyouvong5478 2 года назад

    best. explanation. ever.

  • @RuloGames1
    @RuloGames1 2 года назад

    Thanks for this content! i suscribed

  • @procode6881
    @procode6881 3 года назад

    Great one like always!

  • @varunshrivastava2706
    @varunshrivastava2706 2 года назад

    This code doesn't work for when graph = {0:[1]}

  • @gopis702
    @gopis702 Год назад

    Can u send the code version, os this graphics,. I mean code for this graphics in c language

  • @algorithm808
    @algorithm808 3 года назад

    Appreciate it

  • @prashasthakovuri3704
    @prashasthakovuri3704 3 года назад

    This doesn't work for the case if topological sorting is not possible for a certain input

    • @insidecode
      @insidecode  3 года назад +1

      Yes sure, I mentioned the fact that it doesn't work on graphs that contain cycles

    • @prashasthakovuri3704
      @prashasthakovuri3704 3 года назад

      @@insidecode yeah you mentioned but the code doesn’t work for that case. May I know what change should be done in order to fix it?

    • @insidecode
      @insidecode  3 года назад +2

      @@prashasthakovuri3704 Yes the code assumes that the input is valid, and to "fix" it, you need a function that checks if a graph has no cycles, which can be done with a simple DFS traversal

    • @prashasthakovuri3704
      @prashasthakovuri3704 3 года назад

      @@insidecode thanks a lot for the response 😄👍
      So nice of you !!

    • @insidecode
      @insidecode  3 года назад

      @@prashasthakovuri3704 You're welcome!

  • @europebasedvlogs1251
    @europebasedvlogs1251 Год назад

    Watch at 0.5

  • @keremcihan3577
    @keremcihan3577 7 месяцев назад

    hocam türkseniz türkce ceksenize videolaei ag