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
Discover the new graph theory algorithms course: inscod.com/graphalgo 🔴 / \ 🔵-🔴 | | 🔴-🔵
@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
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
2 жыл бұрын
You're welcome!
Honestly your channel is one of my top 3 go to whenever i face challenges understanding DSA concepts
Best explanation of topological sort on youtube!
Thank you so much, I was so lost with my book. Cleared right up
is this using depth first? And are there multiple correct sequences?
This channel is criminally underrated.
@insidecode
2 жыл бұрын
Thanks for your comment!
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
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
just became a genius, i am gonna nail this examn thanks
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
2 жыл бұрын
That's amazing!
Very good video, as always. Thank you so much!
@insidecode
2 жыл бұрын
You're welcome!
love your post, thanks for sharing!
@insidecode
2 жыл бұрын
You're welcome!
Clever example of a situation leading to a graph! 😅
Very well explained..! What are the practical usecases of the topological sort?
@insidecode
2 жыл бұрын
It can be used for example in projet management when there are tasks that have to be done because some other ones
Great one like always!
@insidecode
2 жыл бұрын
Thanks!
Can u send the code version, os this graphics,. I mean code for this graphics in c language
This code doesn't work for when graph = {0:[1]}
Thanks for this content! i suscribed
@insidecode
2 жыл бұрын
You're welcome!
Appreciate it
best. explanation. ever.
@insidecode
2 жыл бұрын
Thankss
Watch at 0.5
This doesn't work for the case if topological sorting is not possible for a certain input
@insidecode
2 жыл бұрын
Yes sure, I mentioned the fact that it doesn't work on graphs that contain cycles
@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
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
2 жыл бұрын
@@insidecode thanks a lot for the response 😄👍 So nice of you !!
@insidecode
2 жыл бұрын
@@prashasthakovuri3704 You're welcome!
hocam türkseniz türkce ceksenize videolaei ag