Love from Indian student. Recommended all my friends 🙂. Best explanation. I saw explanation and coded and my fear for graphs vanished. I always need initially a good explanation and you deliver the best 🔥
@AlgosWithMichael4 жыл бұрын
Thats awesome! Graphs are intimidating at first for sure. Thanks for sharing, commenting, and watching my videos!
@krishnachaitanya1672 жыл бұрын
Same here, his explanation is enough for me to pass all the test-cases on leetcode. Thanks Michael!!
@IronPrometheus3 жыл бұрын
About implementing through BFS or DFS. Indeed their overall runtime and memory complexities are about the same. However, on BFS queue, it can consume far more heap memory for large graphs with a high degree outgoing edges. This is due to the fact that the queue stores tons of intermediate paths that potentially lead to nowhere at once. DFS, on the hand, keeps only one path that has not reached the target node yet (single backtrack path).
@NotNotNithin4 жыл бұрын
I was watching a different video yesterday for the same problem and I couldn't understand the approach taken. After watching this I got to know how I can approach Graph problems. The way you write the diagram is the way you code. You made it seem so simple. Thanks. Kind request is to make videos on Leetcode Medium Hard problems of Google.🙏🙏🙏🙏 please!!!!
@AlgosWithMichael4 жыл бұрын
That is exactly my goal, I'm glad you got use out of it!
@jawadistube2 жыл бұрын
Hey Mate, Your videos are great and As a developer, I want to say that you are doing very well. You are also the best at coding and that's our pleasure that you make videos for us. The only thing I wanna mention here is that the input which you have taken is not correct at 0:33. In the question the input is [[1,2],[3],[3],[]] but you take [[1,2],[3],[1,3],[]]. However this is very informative
@mihirk9534 жыл бұрын
Thanks a lot! It was a very easy to understand approach. I solved the problem using C++.
@AlgosWithMichael4 жыл бұрын
Awesome, thanks for watching!
@vandetpin42884 жыл бұрын
+1 for very clear explanation of Time and Space complexity analysis !
@AlgosWithMichael4 жыл бұрын
Anytime :)
@harinijeyaraman87892 жыл бұрын
Almost all other tutorials only show the DFS method, thanks for this video, great explanation ! Please make a playlist of Graph questions and DP questions.
@AlgosWithMichael2 жыл бұрын
Appreciate the support!
@vineethsai15752 жыл бұрын
Great solution, Just want to point out that there is a backtracking solution which eliminates the need to copy over the path again and again. Which brings the time complexity down to O(N * 2^N)
@fabusuyiayodeji70164 жыл бұрын
this is super brilliant. best solution I've seen to this question
@AlgosWithMichael4 жыл бұрын
Awesome, glad to hear :)
@BryanJimenez14 жыл бұрын
The solution I was looking for! I saw that people answered this question using backtracking or DP.
@AlgosWithMichael4 жыл бұрын
Yep this is an easier way I think!
@konstantinosblatsoukas36582 жыл бұрын
Thanks for the explanation Michael!
@275phuongvy4 жыл бұрын
great explanation! You deserve more subscribes. Please solve more easy and medium leetcode problems about graph too. Thank you.
@AlgosWithMichael4 жыл бұрын
Thank you so much, more videos are on the way!
@pavittarkumarazad32594 жыл бұрын
Yeah! He explained it pretty well. I don't know about others but I'm sure this is the best explanation one could ever give for this question.
@midasama31244 жыл бұрын
Incredible solution! Thanks for the effort.
@AlgosWithMichael4 жыл бұрын
Glad you like it! Thanks for watching
@yasssh78354 жыл бұрын
Thank you so much! Concise and short.
@AlgosWithMichael4 жыл бұрын
You are very welcome!
@AngadSingh973 жыл бұрын
Really well explained. Thanks, I subscribed to your channel.
@AlgosWithMichael3 жыл бұрын
Thanks for the sub!
@m.movsar2 жыл бұрын
The best explanation! Thank you!
@UCS_RheaRaviSharma-fs9bs4 жыл бұрын
Amazing explanation. Really thankful!!!!
@AlgosWithMichael4 жыл бұрын
You are welcome! Thanks so much for watching!
@sanjayizardar22634 жыл бұрын
Great explanation Michael! Can you please some more complicated graph questions?
@AlgosWithMichael4 жыл бұрын
Of course, let me know if you have any in mind! Thanks for watching
@atuldubey8146 Жыл бұрын
Great explanation :)
@ray8110303 жыл бұрын
TC analysis: 11:10
@mrcgaming93062 жыл бұрын
Very nice explanation bro thank you so much 👍
@naveenraj27274 жыл бұрын
Thank you Miguel. it was very easy to understand!
@AlgosWithMichael4 жыл бұрын
Glad to hear that!
@TheRuancarlo Жыл бұрын
I want to see a solution for a undirected acyclical multigraph
@rakeshgupta89013 жыл бұрын
you made this so simple. thanks for explaining,
@AlgosWithMichael3 жыл бұрын
Glad it helped!
@srinivasanapps3 жыл бұрын
Thanks great explanation. How the given input is parsed and converted into int[][]? [[1,2],[3],[3],[]] -> {{1,2},{3},{3},{}}
@babu13083 жыл бұрын
I am looking for same :(
@rivaille88673 жыл бұрын
This can be done with topsort dp in linear time
@chirag86274 жыл бұрын
Great!! keep them coming!!
@AlgosWithMichael4 жыл бұрын
More to come!
@staubi24433 жыл бұрын
Thanks for this solution!!!!
@AlgosWithMichael3 жыл бұрын
Glad it helped!
@karankanojiya76723 жыл бұрын
Subscribed !! Respect ++
@AlgosWithMichael3 жыл бұрын
Appreciated!
@code74344 жыл бұрын
Hi please add Shortest Bridge leetcode question. Basically concept of multi source shortest path
@AlgosWithMichael4 жыл бұрын
I haven't seen this one before, thanks for letting me know!
@code74344 жыл бұрын
@@AlgosWithMichael actually realising multisource bfs is tough. So ur explaination will help a lot
@baidya874 жыл бұрын
awesome explanation! thanks a lot
@AlgosWithMichael4 жыл бұрын
No problem man
@SR-we1vl4 жыл бұрын
I Came I Saw I Subscribed!
@AlgosWithMichael4 жыл бұрын
Wow thanks!
@djnemo84883 жыл бұрын
I am not able to execute the code. It shows error
@rohitmathur97234 жыл бұрын
Wow man you explained it really well!! Great work!
@AlgosWithMichael4 жыл бұрын
Glad you liked it!
@MrThepratik4 жыл бұрын
great explaination
@AlgosWithMichael4 жыл бұрын
Thank you!
@TeddyDeanShorts3 жыл бұрын
What if the result list isn't counted as "extra" space? How would you analyse the space complexity without the result list?
@AlgosWithMichael3 жыл бұрын
If the result list didn't count and no recursion was being used, it would likely just be O(1) space.
@rajeshb15044 жыл бұрын
Can you please solve Longest Palindrome in given string?
@AlgosWithMichael4 жыл бұрын
Definitely!
@faiqarif57654 жыл бұрын
Why can't this be solved using dp?
@AlgosWithMichael3 жыл бұрын
Hmm maybe it can, but I don't know how to do it :p
@heisenberg18444 жыл бұрын
Amazing.
@AlgosWithMichael4 жыл бұрын
Thanks man!
@davidluong984 жыл бұрын
thank you
@AlgosWithMichael4 жыл бұрын
No prob, thanks for watching!
@furkancevik9333 жыл бұрын
nice video
@AlgosWithMichael3 жыл бұрын
Thanks!
@soneshengg3 жыл бұрын
Sorry but time complexity didnt make much sense if you could go in more detail.