Towers of Hanoi: A Complete Recursive Visualization

This video is about an in depth look at one of the most challenging recursive problems for computer science students: Towers of Hanoi. We first take the perspective of how we would solve it if it was just a puzzle, where we look specifically at developing a general strategy. Afterwards, we then convert this strategy into a complete recursive solution to the problem. On the way to this solution, we learn a framework to think about and solve tough recursive problems like this one. We finish the video by take a step back and analyzing the recursive solution and how the recursion unravels.
Support: / reducible
This video wouldn't be possible without the open source manim library created by 3blue1brown: github.com/3b1b/manim
Here is link to the repository that contains the code used to generate the animations in this video: github.com/nipunramk/Reducible
Music:
October by Kai Engel freemusicarchive.org/music/Ka...
November by Kai Engel
freemusicarchive.org/music/Ka...
Cobweb Morning by Kai Engel
freemusicarchive.org/music/Ka...

Пікірлер: 495

  • @boredpotato6366
    @boredpotato63664 жыл бұрын

    If you keep making videos like this, you'll become the best and most famous CS teacher on KZread.

  • @codeoncloudtv7193

    @codeoncloudtv7193

    3 жыл бұрын

    I agree. Never see someone like him. So passionate

  • @princessassmunch4354

    @princessassmunch4354

    3 жыл бұрын

    The amount of ads on this video fucking disgusts me tho.

  • @lqv3223

    @lqv3223

    3 жыл бұрын

    @@princessassmunch4354 Man’s gotta make his bread. At this point, only 20 people support him on Patreon and he has tens of thousands of viewers who get such amazing content for free.

  • @princessassmunch4354

    @princessassmunch4354

    3 жыл бұрын

    @@lqv3223 He can't tone it down just a little? I mean for God sakes man, fucking 6 ads on a 20 min video.

  • @lqv3223

    @lqv3223

    3 жыл бұрын

    @@princessassmunch4354 That sounds like a lot tbh. A portion of my premium membership fee goes towards this channel, making it easier to support this channel and guarantee an ad-free experience. I'm sure he'll tone down the number of ads once he has a decent number of subscribers.

  • @leonardofillipe7668
    @leonardofillipe76683 жыл бұрын

    Now I realized that the steps for recursive problem solving is basically the same steps taken in induction proofs in mathematics.

  • @HuyTran-ny7mg

    @HuyTran-ny7mg

    3 жыл бұрын

    That's why they're usually taught together in discrete math courses for computer science!

  • @angrymurloc7626

    @angrymurloc7626

    3 жыл бұрын

    There is a generalized version of induction called "structural induction" which has uses in proving things about recursively defined objects

  • @srujangurram

    @srujangurram

    2 жыл бұрын

    @@HuyTran-ny7mg yes I learnt that along with recursive functions in discrete math

  • @curiosdevcookie

    @curiosdevcookie

    2 жыл бұрын

    I’m stunned 😮

  • @_mrmark

    @_mrmark

    Жыл бұрын

    Now I realized that I do not understand anything in either one or the other.😭

  • @JamesJon1187
    @JamesJon11872 жыл бұрын

    If anyone else had didn't immediately catch the logic behind the " other = 6 - (start + end) ", it's because if you tally up the values of rods 1,2, 3 that will equal six. Thus if start = rod 1 and end = rod3, 6-(rod1+rod3) = rod2, thus "other = rod2".

  • @mohammedsuhail1500

    @mohammedsuhail1500

    2 жыл бұрын

    u made my day thank you:)

  • @ryannickles3218

    @ryannickles3218

    Жыл бұрын

    I was just about to say that "6" appears to be a *magic number* that should be defined based on core principles. Thank you for elucidating.

  • @isaiahpaul56

    @isaiahpaul56

    Жыл бұрын

    @@ryannickles3218 lol same

  • @thomaslao9832

    @thomaslao9832

    Жыл бұрын

    unless you are using indices to store values or calculating distance between indices or having some kind of significance with adding up the labels of the rods, im going to call that "logic" presented in the video magic numbered bullshit for the sake of pseudo-genius content.

  • @mohammadraddad9446

    @mohammadraddad9446

    Жыл бұрын

    so if I had 4 rods it will be (1+2+3+4) => 10-(strat+end)?

  • @anujjadhav2175
    @anujjadhav21753 жыл бұрын

    I am a simple person, I see recursion, I panic.

  • @markomozina7894
    @markomozina78944 жыл бұрын

    I can’t even belive that the video of this quality has so few views. Keep up the good work!

  • @jonathanhirsch1717
    @jonathanhirsch17173 жыл бұрын

    My jaw literally dropped when I saw that you had 32k subs, I was expecting over 500k!!! But now you're one sub closer!

  • @ThatOneEgoLifter

    @ThatOneEgoLifter

    3 жыл бұрын

    Geez, SubCount Tripled in 1 month

  • @igor-yc7ey
    @igor-yc7ey3 жыл бұрын

    Great explanation! Just a suggestion: highlight which line of the code is doing each step as you explain it

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

    I feel so stupid.

  • @gisellekoch3710

    @gisellekoch3710

    Ай бұрын

    I am

  • @pankajbisht897
    @pankajbisht8973 жыл бұрын

    the effort you put into explaining these complex concepts is unimaginable. I have never seen this kind of presentation for explaining an algorithm. Keep it up please.

  • @puspamadak
    @puspamadak3 жыл бұрын

    I don't ever take the time to think of such hard problems. But your lessons gives me confidence. Thanks a lot!

  • @tmorid3
    @tmorid33 жыл бұрын

    This is actually an amazing video, with super clear and simple explanations and animations. This is absolutely amazing and mind blows. Thank you so much

  • @jocelynchang183
    @jocelynchang1833 жыл бұрын

    This video is soooo great! It took me awhile, but after repeating your video for 5 times, I finally understand this completely and was able to even work out examples with 5+ discs on my own. Thank you so much!!!

  • @samuelsitina8558
    @samuelsitina85582 жыл бұрын

    The simplicity of the code is truly beautiful.

  • @fairextl
    @fairextl3 жыл бұрын

    I was thinking about this problem a while back, today I got one of your videos recommended to me, and now I'm here! Astounding explanation!

  • @mohammedsanaullah1065
    @mohammedsanaullah10654 жыл бұрын

    Im really glad that KZread finally recommended something that I really needed. Your passion for CS I really resonate with. Amazing video and unparalleled explanation. After encountering recursion, my interest in dynamic programming dwindled quite a lot, but your videos really helped me overcome this hurdle of mine. Many thanks, keep up the amazing work, Here's to hoping for more amazing content Cheers!

  • @Reducible

    @Reducible

    4 жыл бұрын

    Wow, that is one powerful comment Mohammad! Thanks for taking the time to write it and comments like yours mean a lot to me. I'm glad this video helped rekindle your interest in recursion and dynamic programming. Those are hard topics so there's no shame in admitting that they can be frustrating, and the goals of videos like this are to find a way past that frustration and focus on learning the beauty of the concepts, however hard that can be at times. I'm happy that you were able to see that through this video. I'm definitely planning on making future content, so stay tuned!

  • @HalfEye79
    @HalfEye793 жыл бұрын

    A few years ago, I solved the towers of hanoi with a loop. I assumed, that there are always three rods. And I said, that an empty rod is a very large disc. I only needed one input: the number of discs. I had realized quite another pattern, for which it is important, whether the number of discs is odd or even. The pattern is, that every other move is the move of the smallest disc. If the number of discs is odd, it always moves start -> end -> other -> start. If the number of discs is even, it always moves start -> other -> end -> start. The other move is always the smaller of the two discs on top of the bigger disc. This solution might might have a few memory issues, but it works.

  • @juliuskadel7696

    @juliuskadel7696

    Жыл бұрын

    That is so interesting

  • @muhammadumarorakzai

    @muhammadumarorakzai

    9 ай бұрын

    that is how i solved it for my C lab problem. had to play it so many times to figure out that pattern

  • @iszaffar
    @iszaffar3 жыл бұрын

    Thank you for taking the time and effort to make this video. The quality of the editing and animations in the video are excellent and remind me of 3Blue1Brown's videos. Great explanation and it really helped me to visualise and understand how this problem works!

  • @Reducible

    @Reducible

    3 жыл бұрын

    Thanks for the awesome comment! Glad this content helped you with this problem!

  • @alinac5512

    @alinac5512

    3 жыл бұрын

    Lol, I was thinking of 3blue1brown too.

  • @chriswu6823

    @chriswu6823

    3 жыл бұрын

    @@Reducible was that intro a reference to his ted talk hahaha

  • @abhirup619
    @abhirup6198 ай бұрын

    spent 2 hours last year trying to understand towers of hanoi without any context (just by lloking at code) ...finally gave up and now, after you explained the recursive approach I coded it in python in 10 minutes. just shows what a huge difference a systematic approach can make. your video helped me immensely. thank you

  • @jayantverma6196
    @jayantverma61964 жыл бұрын

    This was so awesome man, i watched all of your videos and they are amazing. Big fan here!!!!!

  • @harikrishnan204
    @harikrishnan2043 жыл бұрын

    the explanation is amazing! I hope you make more videos on more algorithmic problems. there are very few on youtube who explain with such clarity

  • @bhautiksavaliya3635
    @bhautiksavaliya36353 жыл бұрын

    The best explanation with the best visual animation. An extraordinary work. Thank you very much and please keep doing it.

  • @lakshyamangal51
    @lakshyamangal513 жыл бұрын

    thank you so much man ❤️ please keep making videos like this 🙏the quality and simplicity you have is unmatched.

  • @eduardorios6463
    @eduardorios64633 жыл бұрын

    Thank you so much for these awesome videos. I'm currently taking course MITx 6.00.1x over on edX and your videos are really helping me understand the concepts. Thank you again.

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

    Honestly great job dude You have much respect from me I havent seen anyone having such a great ability making something so complex , look so easy

  • @bntejn
    @bntejn3 жыл бұрын

    Beautiful. You’re really talented at unraveling seemingly complex concepts very elegantly. After watching your videos, I can’t help but knowing the concepts matter-of-factly. And wonder to myself why I wasn’t able to get it earlier.

  • @maheshvshet
    @maheshvshet4 жыл бұрын

    You amaze with awesome content. The explanation was some understandable, I can hardly forget it. Thanks.

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

    the best videos that i have ever watched that explains Towers of Hanoi. I love this channel. Keep up the good work. I can't wait watching this kind of vids.

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

    Greatest video ever on towers of hanoi problem. Even though I have tried to understand this problem number of time I finally understood it here. Because I was trying to name the discs as well but now I realised it isn't necessary since we'll always be moving top disc on a certain rod. Absolutely amazing way of explaining!! Keep it up!!🎉

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

    Thank you so much. This is by far the best explanation on youtube for this problem. Thoroughly understood the logic because of the amazing animation.

  • @vsk0208
    @vsk02083 жыл бұрын

    Best explanation I have seen on KZread, I appreciate your effort. Thanks for uploading this video :)

  • @umchoyka
    @umchoyka3 жыл бұрын

    Holy crap, that 3 step list gave me an "aha!" moment. Great video!

  • @noorfathima3499
    @noorfathima34993 жыл бұрын

    This is the best explanation I have come across till date!! and nothing can be better than this.. thank you

  • @zhangyi5145
    @zhangyi51453 жыл бұрын

    It was my biggest challenge when I started my CS course. It's a wonderful presentation, what a great work!

  • @SaumyaSharma007
    @SaumyaSharma0073 жыл бұрын

    Best Teacher Award goes to u Man..... Seriously best explanation I have ever seen 👌🔥🔥🔥🔥🔥

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

    What an insane work you did here. It's awesome. Thank you so much!

  • @dacfniel5442
    @dacfniel54423 жыл бұрын

    Bless you, man. The best explanation on KZread.

  • @surfnerder
    @surfnerder3 жыл бұрын

    As always, fantastic video, thanks a lot! I'm certain you know about this and just didn't mention it to keep things organized and a little more intuitive but I'd like to point it out anyways for the fellow viewers who might be interested: You can simplify the code even further when having n = 0 as your base case. It sounds kind of useless at first but solving the problem with 0 discs just means “do nothing“ which allows you to save space in your code: def h( n, start, end): if n = 0: do nothing else: other = 6 - (start + end) h(n - 1, start, other) pm(start, end) h(n - 1, other, end) ...this boils down to: def h( n, start, end): if n > 0: other = 6 - (start + end) h(n - 1, start, other) pm(start, end) h(n - 1, other, end)

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

    Such a beautifully visualised video that I was able to code it within minutes of seeing it. Thank you so much

  • @mohd.salahuddinansari8008
    @mohd.salahuddinansari80083 жыл бұрын

    This is the best explanation of tower of hanoi on KZread. So thanks a lot.

  • @ershadulrayhan7324
    @ershadulrayhan73243 жыл бұрын

    Thank you very much for this video. You have not only explained the problem easily but also introduced us to a framework to solve recursive problems. 👍

  • @Reducible

    @Reducible

    3 жыл бұрын

    Thanks for the kind comment! Glad to hear that this content helped you!

  • @clemofunhound8381
    @clemofunhound83812 жыл бұрын

    You saved my day! I am taking a course on discrete mathematics and this was a heck of an explanation!!!! Cheers!

  • @williamrutherford553
    @williamrutherford5533 жыл бұрын

    Great video for introducing the puzzle! One piece of critique though, When you talked about the "recursive leap of faith" (the induction hypothesis) you took n-1 to mean the second to last domino. This can be a bit confusing. I think it's more explanatory if you just said: Pick any domino, and assume it will fall over. If it falls over, prove the next domino (+1) will ALSO fall over. Thus, the first domino falls because of the base case. The second domino falls down, because the first one falls. The third falls, because the second falls because the first, etc etc. That explanation is better at showing how a proof by Induction kind of "cascades" like dominoes, proving every case. Otherwise, it can seem a bit like assuming something random, just to come up with a result.

  • @Reducible

    @Reducible

    3 жыл бұрын

    Ah, that is a subtle and good point. Thanks for the feedback!

  • @sandeepverma-mp9co

    @sandeepverma-mp9co

    Жыл бұрын

    Yes that was a bit confusing

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

    Nobody could have explained it better..genius.The dominos concept is gold!

  • @anjumaurya6233
    @anjumaurya62333 жыл бұрын

    Thankyou so much for the wonderful explanation. Your efforts are like blessings for the learners.

  • @mariiatverdokhlib2057
    @mariiatverdokhlib20577 ай бұрын

    Your work brought a lot of insights into solving recursive tasks, thanks!

  • @VirajChokhany
    @VirajChokhany3 жыл бұрын

    Thank you so much Sir. It gives such satisfaction about understanding these concepts so clearly. Often I end up facing problems while solving recursion and backtracking problems. Please do make videos on those topics. 💓

  • @user-dp7ye3cg2z
    @user-dp7ye3cg2z Жыл бұрын

    This is the video that explains the problem the best so far.

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

    This, indeed, blew my mind! Thank you so much! This was very interesting and educational to me!

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

    Simply no words to praise this person! I often feel lazy for leaving comments on youtube videos, but this time I must. Kindly make a playlist for explaining the theory of all the data structures and algorithms.

  • @AnantaAkash.Podder
    @AnantaAkash.Podder26 күн бұрын

    By Far the Best Explanation Ever for Recursion with Those Tips😀😀

  • @arielcavalcante8187
    @arielcavalcante81873 жыл бұрын

    after watching the code part (from 16:00 to 20:00) a couple of times and not understanding a single thing, I wrote the functions on paper and watched again and my mind blew away. Damn you're amazing.

  • @Saikiran-pf1ry
    @Saikiran-pf1ry3 жыл бұрын

    You need more views! Excellent explanation. Nothing can beat the Aha moment when you actually understand how something works! Thanks a ton

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

    Thank you so much for this. No one has explained recursion as well as you did. I had a similar problem to this in one of my assignments: Find recursive function to solve a tower of hanoi for n discs if you want to move them from 1st peg to 3rd peg and you can only move discs to an adjacent peg. I was overwhelmed when I tried it on my own the first time but after watching your video I was able to figure out the solution for this modified version of the problem. Keep up the great work.

  • @praphulyadav4471
    @praphulyadav44712 жыл бұрын

    thank you very much i never thought this problem will be so simple to understand. you made this hard problem very simple

  • @piperamp3331
    @piperamp33313 жыл бұрын

    Thanks so much! This video and your last video about recursion helped me understand the topic way better.

  • @akhilgupta3664
    @akhilgupta36644 жыл бұрын

    This video just explained it in easy manner.. Using animations make things to understand easily...Carry on and keep on adding the videos of data structures and algorithms in your playlist ..😀 Eagerly waiting for next video !!! Happy Learning !!

  • @Ayan-od8hk
    @Ayan-od8hk Жыл бұрын

    Best explanation ! I tried understanding this problem before but gave up, thankfully I found this video

  • @nikosrouskas2438
    @nikosrouskas24382 жыл бұрын

    Amazing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I have been trying to solve this problem for a while now and I was so confused with other solutions on the internet (the code of the solutions) but yours is extremely intuitive and elegant. I am very new to recursion and you made this so understandable. THANKS! I hope you continue making such videos because you really really help the community!

  • @kedardeshmukh1168
    @kedardeshmukh11688 ай бұрын

    This is the best video visualization of any CS concept i have erver seen....... Keep it up

  • @sparrrooww5473
    @sparrrooww54733 ай бұрын

    Very detailed and simple explanation. Keep up the good work

  • @fangle0121
    @fangle01213 жыл бұрын

    Thank you so much! The animations are amazing to aid our understanding of this problem. :)

  • @Reducible

    @Reducible

    3 жыл бұрын

    Thank you for the kind comment and I'm glad the animations were able to help with your understanding!

  • @tlqy
    @tlqy3 жыл бұрын

    You are the 3blue1brown of computer science. Keep it up!

  • @swapnilnagar4710
    @swapnilnagar47103 жыл бұрын

    Mindblowing explanation and animation! That 'Dominos' concept :), I personally liked it!

  • @Reducible

    @Reducible

    3 жыл бұрын

    Thank you, I had a lot of fun making that domino animation so glad you appreciated it!

  • @alkamishra9974
    @alkamishra99743 жыл бұрын

    Great video. Only watched a couple of videos of tours but can tell your love for the subject.

  • @uljhe_hue_wires_ka_khambha
    @uljhe_hue_wires_ka_khambha11 ай бұрын

    Great explanation, cleared the confusion to a great extent. Thanks

  • @alexkang7336
    @alexkang73363 жыл бұрын

    These videos remind me of 3blue1brown's videos. Really appreciating your work! Thank you!

  • @vijaykumarreddyalavala3713

    @vijaykumarreddyalavala3713

    3 жыл бұрын

    3blue1brown to maths is Reducible to Algorithms

  • @jacksonwang3974
    @jacksonwang39743 жыл бұрын

    This is the visual version of CS Bible. A ton of respect and appreciation

  • @darasimiajewole007
    @darasimiajewole0072 жыл бұрын

    My mind is absolutely blown by this solution

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

    Woooow, this is mind blowing. I'll try to understand this again. Thanks for making it visual, I can undertake something

  • @susantipsyhealy7655
    @susantipsyhealy7655Ай бұрын

    I have never been good in math, even simple math. I have an app called IMPULSE. One of the games is Tower of Hanoi. It started out relatively simple but I was taking so long to finish each level and was ending up at 2% of the number of moves and time used. So i searched out a video to help me understand how this game works. I never thought it was a mathematical problem. One of my issues is my ADHD & ASD brain. Trying to keep organized in my thinking is not easy. But now I hope to finish my next level in much fewer moves. I will never reach a faster time, but improving in fewer moves is now my biggest goal. Thank you for this video

  • @Arya-mf3ey
    @Arya-mf3ey3 жыл бұрын

    He made it so simple. Thank you.

  • @aminmaleki4592
    @aminmaleki4592Ай бұрын

    Best explanation to Hanoi tower and its basis in discrete mathematics and algorithms, This is multi target video!!

  • @rmatarrita
    @rmatarrita2 жыл бұрын

    I had solved this problem on my own before watching the video. Btw, in my personal case I found the iterative solution harder to come up with than the recursive one. Since I had already solved this problem before watching the video, what blew mi mind was the little arithmetic "hack" to find the "other" rod: 6 - (start + end) LOL. Great stuff!

  • @eriktruong9856
    @eriktruong98562 жыл бұрын

    What is the reason for other = 6 - (start + end). There are 10 disks on the example? 14:02. If the first, second and third rod was labeled 1,2 and 3. Then the other rod is 6- (start+end). Is there a 4th rod? Edit: After som afterthought I think you possibly referring to the sum of tower numbers 1+2+3 = 6, but this wasn't explained deeply enough to be satisfying. So essentially this is a method of finding the auxiliary rod at any given time in the recursion.

  • @debjeet5715

    @debjeet5715

    2 жыл бұрын

    Your comment helped here. Thanks mate 🤜🏼

  • @quyenscc

    @quyenscc

    2 жыл бұрын

    We always have 3 rods: 1, 2 and 3. When start is 1, end is 2, then other is 6-(1+2) = 3. When start is 1, end is 3, then other is 6-(1+3) = 2. When start is 2, end is 3, then other is 6-(2+3) = 1, and so on. Thus, the formula makes sense.

  • @nikosrouskas2438

    @nikosrouskas2438

    2 жыл бұрын

    It was quite clear I think

  • @charlierock000

    @charlierock000

    2 жыл бұрын

    @@nikosrouskas2438 I think he though he had to add the number of disks in each rod

  • @ponyride23

    @ponyride23

    4 ай бұрын

    @@quyenscc Thank you! Our teacher taught us by naming the rods 'from', 'to' and 'other' and passing them as string parameters 'A', 'B', 'C'. The lesson was on divide and conquer though, not recursion, maybe that's why.

  • @ImBlackDragon
    @ImBlackDragon2 жыл бұрын

    Thank you for existing🙏.

  • @davedsp8513
    @davedsp85132 жыл бұрын

    I remember this being a pancake themed recurring puzzle in a Professor Layton game when I was young. I didn't understand the whole recursive ramifications of it but I'm pretty proud I managed to figure out the general strategy of breaking it down to each smaller tower

  • @12jgy
    @12jgy3 жыл бұрын

    Love this! I just recently discovered this channel through the FFT video (KZread recommendations) and I just immediately loved it! The topics covered are really cool, and I really like the way they're presented in here (Reminds me of 3b1b, not only because Manin is used here to do the bulk of the animations, but too because of the quality of the explanations). Now, one neat little fact about this algorithm for solving the towers of Hanoi is that if you have n disks, this algorithm takes exactly 2^n - 1 steps to complete (The proof is just a simple induction argument for those who might want to try to figure it out), and in fact, if I'm recalling this correctly, this is actually the optimal amount of steps, you can't go any lower than this! Quite fascinating if you ask me.

  • @Reducible

    @Reducible

    3 жыл бұрын

    Thank you for this comment! I absolutely love compliments like this one! And yeah that's a fun inductive reasoning exercise -- fun fact by the way, you can see the number is steps is 2^n - 1 visually by generalizing the tree diagram for the recursion that we did here. In fact, I believe I touched upon this in the Big O notation video with the O(2^n) example. The basic idea is counting the number of nodes in a tree where at each level we have two branches representing calls to n - 1 and continue until we reach the base case of 1. The inductive argument you mentioned also works for solving this problem, but a fun visual addition. Thanks for sharing this!

  • @gautamkumarshukla3055
    @gautamkumarshukla30553 жыл бұрын

    world's best video to show how tower of hanoi works recursively

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

    best video ... literally background music .. soothes my mind

  • @robyfischer4501
    @robyfischer45012 жыл бұрын

    Wow, that's just magic. Thank you for the detailed, visualised and simplified explication. Thanks to you another man on earth understood this problem and by extension a bit about recursion xD. And you obtain a subscriber of course

  • @HuyTran-ny7mg
    @HuyTran-ny7mg3 жыл бұрын

    Underrated channel.

  • @alphamega3306
    @alphamega33063 жыл бұрын

    Excellent explanation. This recursive program definitely blew my mind when I first saw it two days ago. I hand-drew out the stack frames for a 3 disk problem. And even though it worked, I still couldn’t grasp HOW it was working-the abstract idea of n-1 recursively moving sequentially smaller stacks was the part the really got me. After watching this video a second time, it clicked. The crux of the program’s ability is in that assumption that n-1 will work. It’s pretty amazing stuff. Thank you!

  • @autotechtraveller8787

    @autotechtraveller8787

    Жыл бұрын

    Sir can u pls explain me this.. struggling since 4 days..

  • @autotechtraveller8787

    @autotechtraveller8787

    Жыл бұрын

    How can I contact u..

  • @Theooolone
    @Theooolone3 жыл бұрын

    This is completely mind blowing! Will try coding this in Java when I next have time

  • @loveandlive5563
    @loveandlive55632 жыл бұрын

    Great work. Thanks for such an amazing video.

  • @WisdomIsAwesome
    @WisdomIsAwesome3 жыл бұрын

    Wow, just the kind of visualization I wad looking for, for this problem. Thanks!

  • @Reducible

    @Reducible

    3 жыл бұрын

    Glad it helped you out!

  • @hannahcora5939
    @hannahcora59393 жыл бұрын

    oh my gawd after 30mins of trying to understand it from a book, i understood this algo in the first 5 mins watching your video!!!! THANKYOU

  • @dvdpro3726
    @dvdpro37263 жыл бұрын

    damn, this channel is so underrated. I came here after watching your 5 steps for solving recursive problems and I am blown away after seeing that whole thing took only 10 lines of code, that's amazing

  • @diegollanespasos
    @diegollanespasos3 жыл бұрын

    Love the animations!

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

    Thank you so much. I was using n,A,B,C initially which was bit difficult but after watching your video it make more sense now. i.e. n, source, temp, dest as n, A,B,C

  • @quirkyquester
    @quirkyquester3 жыл бұрын

    this video really helped me understand towers of hanoi! Thank you so much!!! This algorithm is so hard to comprehend!

  • @Reducible

    @Reducible

    3 жыл бұрын

    Yeah it's a challenging one -- I think visualizing it out like we did in this video really helps. Thanks for the comment!

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

    This was a G.R.E.A.T explanation. Thank you so much!

  • @Matt-ww9wv
    @Matt-ww9wv3 жыл бұрын

    Excellent video! Thank you very much.

  • @Lallushe
    @Lallushe3 жыл бұрын

    That's a quality video! Thank you!

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

    woooooooooooooooooooooooooooooooooowww!! this was wonderful! the only explanation of this problem that made sense i tried searching all over and failed to get a good explanation of the problem and underlying concepts and this video covers all of it Grant Sanderson would be proud :)

  • @amandubey6331
    @amandubey63312 жыл бұрын

    This is Awesome man! Subbed

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

    Awesome ! Great Explanation

  • @Lee-tj8bn
    @Lee-tj8bn3 жыл бұрын

    Thanks, man!!! This really helped me... very well done, sir.

  • @nikhilgupta7697
    @nikhilgupta76973 жыл бұрын

    Loved your explanation! You earned a sub.

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

    best explanation available on internet

  • @istiakurrahman6567
    @istiakurrahman65673 жыл бұрын

    Thankyou so much for the wonderful explanation.❤❤❤❤❤❤