Topological sort in 5 minutes - Inside code

Ғылым және технология

Source code: gist.github.com/syphh/9c16636...
🔴 Learn graph theory algorithms: inscod.com/graphalgo
⚙ Learn dynamic programming: inscod.com/dp_course
💡 Learn to solve popular coding interview problems: inscod.com/50problems_course
⌛ Learn time and space complexity analysis: inscod.com/complexity_course
🔁 Learn recursion: inscod.com/recursion_course
NB: This video is ad-free, you can choose to support Inside code by purchasing one of the courses above or dropping a super thanks!
NB2: Discounts of courses above are permanent
I also post content on LinkedIn (inscod.com/linkedin) and Instagram (inscod.com/instagram)

Пікірлер: 39

  • @insidecode
    @insidecode Жыл бұрын

    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
    @Shadic352 жыл бұрын

    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 :)

  • @insidecode

    @insidecode

    2 жыл бұрын

    You're welcome!

  • @kwamenani7775
    @kwamenani7775 Жыл бұрын

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

  • @harrisoncamm1054
    @harrisoncamm1054 Жыл бұрын

    Best explanation of topological sort on youtube!

  • @TheBurrito171
    @TheBurrito1714 ай бұрын

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

  • @modetechno7728
    @modetechno77288 ай бұрын

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

  • @tmanley1985
    @tmanley19852 жыл бұрын

    This channel is criminally underrated.

  • @insidecode

    @insidecode

    2 жыл бұрын

    Thanks for your comment!

  • @alejomarchanr
    @alejomarchanr2 жыл бұрын

    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

    2 жыл бұрын

    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

  • @gardcola7946
    @gardcola7946 Жыл бұрын

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

  • @aryan7069_
    @aryan7069_2 жыл бұрын

    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 :)

  • @insidecode

    @insidecode

    2 жыл бұрын

    That's amazing!

  • @jasonzhang1133
    @jasonzhang11332 жыл бұрын

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

  • @insidecode

    @insidecode

    2 жыл бұрын

    You're welcome!

  • @uwspstar2008
    @uwspstar20082 жыл бұрын

    love your post, thanks for sharing!

  • @insidecode

    @insidecode

    2 жыл бұрын

    You're welcome!

  • @peterfarrell66
    @peterfarrell6611 ай бұрын

    Clever example of a situation leading to a graph! 😅

  • @JenilCalcuttawala
    @JenilCalcuttawala2 жыл бұрын

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

  • @insidecode

    @insidecode

    2 жыл бұрын

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

  • @procode6881
    @procode68812 жыл бұрын

    Great one like always!

  • @insidecode

    @insidecode

    2 жыл бұрын

    Thanks!

  • @gopis702
    @gopis702 Жыл бұрын

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

  • @varunshrivastava2706
    @varunshrivastava27062 жыл бұрын

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

  • @RuloGames1
    @RuloGames12 жыл бұрын

    Thanks for this content! i suscribed

  • @insidecode

    @insidecode

    2 жыл бұрын

    You're welcome!

  • @algorithm808
    @algorithm8082 жыл бұрын

    Appreciate it

  • @colbylithyouvong5478
    @colbylithyouvong54782 жыл бұрын

    best. explanation. ever.

  • @insidecode

    @insidecode

    2 жыл бұрын

    Thankss

  • @europebasedvlogs1251
    @europebasedvlogs1251 Жыл бұрын

    Watch at 0.5

  • @prashasthakovuri3704
    @prashasthakovuri37042 жыл бұрын

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

  • @insidecode

    @insidecode

    2 жыл бұрын

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

  • @prashasthakovuri3704

    @prashasthakovuri3704

    2 жыл бұрын

    @@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

    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

    2 жыл бұрын

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

  • @insidecode

    @insidecode

    2 жыл бұрын

    @@prashasthakovuri3704 You're welcome!

  • @keremcihan3577
    @keremcihan35773 ай бұрын

    hocam türkseniz türkce ceksenize videolaei ag

Келесі