Тёмный

Towers of Hanoi: A Complete Recursive Visualization 

Reducible
Подписаться 289 тыс.
Просмотров 470 тыс.
50% 1

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 522   
@anujjadhav2175
@anujjadhav2175 3 года назад
I am a simple person, I see recursion, I panic.
@leonardofillipe7668
@leonardofillipe7668 3 года назад
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.😭
@monkmode9138
@monkmode9138 2 года назад
I feel so stupid.
@gisellekoch3710
@gisellekoch3710 5 месяцев назад
I am
@minneso5424
@minneso5424 Месяц назад
I am think you are not stupid, just imagine you can read and write it takes a lot, and you can differentiate between squares and triangles a lot of monkey cant do it
@yashitabhoria8398
@yashitabhoria8398 3 часа назад
you're not alone
@boredpotato6366
@boredpotato6366 4 года назад
If you keep making videos like this, you'll become the best and most famous CS teacher on RU-vid.
@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.
@JamesJon1187
@JamesJon1187 3 года назад
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 2 года назад
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)?
@igor-yc7ey
@igor-yc7ey 3 года назад
Great explanation! Just a suggestion: highlight which line of the code is doing each step as you explain it
@abhirup619
@abhirup619 Год назад
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
@eriktruong9856
@eriktruong9856 3 года назад
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 8 месяцев назад
@@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.
@tmorid3
@tmorid3 3 года назад
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
@markomozina7894
@markomozina7894 4 года назад
I can’t even belive that the video of this quality has so few views. Keep up the good work!
@aminmaleki4592
@aminmaleki4592 5 месяцев назад
Best explanation to Hanoi tower and its basis in discrete mathematics and algorithms, This is multi target video!!
@jonathanhirsch1717
@jonathanhirsch1717 3 года назад
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
@nikosrouskas2438
@nikosrouskas2438 2 года назад
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!
@Ayan-od8hk
@Ayan-od8hk Год назад
Best explanation ! I tried understanding this problem before but gave up, thankfully I found this video
@alexkang7336
@alexkang7336 4 года назад
These videos remind me of 3blue1brown's videos. Really appreciating your work! Thank you!
@vijaykumarreddyalavala3713
@vijaykumarreddyalavala3713 3 года назад
3blue1brown to maths is Reducible to Algorithms
@mohammedsanaullah1065
@mohammedsanaullah1065 4 года назад
Im really glad that RU-vid 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!
@harikrishnan204
@harikrishnan204 3 года назад
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
@williamrutherford553
@williamrutherford553 3 года назад
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
@HalfEye79
@HalfEye79 3 года назад
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.
@kadelchess42
@kadelchess42 Год назад
That is so interesting
@muhammadumarorakzai
@muhammadumarorakzai Год назад
that is how i solved it for my C lab problem. had to play it so many times to figure out that pattern
@crjacinro
@crjacinro 3 года назад
More contents please! Would like to see some visual explaination on other problems in DSA. Maybe some hard problems on leetcode or google interview questions.
@hannahcora5939
@hannahcora5939 3 года назад
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
@khiryshank4930
@khiryshank4930 3 года назад
Holy f*** the domino visual made it all click for me!
@Saikiran-pf1ry
@Saikiran-pf1ry 3 года назад
You need more views! Excellent explanation. Nothing can beat the Aha moment when you actually understand how something works! Thanks a ton
@danielnomotsu3777
@danielnomotsu3777 2 года назад
I got lost at pm(1,2). Don't know which line of code is doing that and from there don't also know how start and end keep changing from their given values e.g: start is 1 but then it becomes 3 later on and I don't get where the change in value is coming from. Any form of help is explaining is appreciated
@divinityinversace
@divinityinversace Год назад
do u understand itnow
@uljhe_hue_wires_ka_khambha
@uljhe_hue_wires_ka_khambha Год назад
Great explanation, cleared the confusion to a great extent. Thanks
@VirajChokhany
@VirajChokhany 4 года назад
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. 💓
@thachkiencao3883
@thachkiencao3883 3 года назад
The thing is i subscribe to your channel in my first arrival to the channel after seeing this video I dont often do that to other channels Keep goodjob!
@kal5211
@kal5211 3 года назад
Megablocks :: Legos , Reducible :: 3Blue1Brown
@tastypie2276
@tastypie2276 Год назад
This, indeed, blew my mind! Thank you so much! This was very interesting and educational to me!
@rishsama2048
@rishsama2048 2 года назад
Demnnn , appreciate it!!, Get to see all the visualisation of disks nd rods, that how the recursion actually works here .
@anjumaurya6233
@anjumaurya6233 4 года назад
Thankyou so much for the wonderful explanation. Your efforts are like blessings for the learners.
@fullViewJay
@fullViewJay Год назад
This was super effective and the example at 16:12 made it that much more understandable. If there's anything I could add, it would be that something like a pointer that was cycling through the line of code that was taking place for the recursive function would have tied everything together. Great job nevertheless
@jonathanpopham5483
@jonathanpopham5483 Год назад
Don't need a "leap of faith" if you prove the n+1 case, this is the principle of mathematical induction. If n is a natural number (n >= 1 in CS terms), and the function holds in the basis case (n=1, the smallest value for which the statement is true), then it is necessary to prove the n+1 case. It is convention in mathematics to assign n = k+1, where k is a natural number that fulfills the base case. If we show that k+1 holds, then that means that we can recursively plug k+1 into k to say that n = (k+1) +1. This process can be repeated for all natural numbers, hence by the principle of mathematical induction the statement is true for all natural numbers. There are no leaps of faith in mathematics. Good video, nice animations.
@sickdarth
@sickdarth 3 года назад
Subscribed. Who tf won't want more videos like this?!
@iszaffar
@iszaffar 3 года назад
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
@MultiQwerty420
@MultiQwerty420 3 года назад
Its not always intuitive to see that the sub problems can be solved the same way as the original problem especially when they share resources like the rods.
@bernardlaughlin6956
@bernardlaughlin6956 3 года назад
How was other = 6 -(start +end) derived?
@maheshvshet
@maheshvshet 4 года назад
You amaze with awesome content. The explanation was some understandable, I can hardly forget it. Thanks.
@dr.deeptiagarwal6138
@dr.deeptiagarwal6138 8 месяцев назад
When anyone doenst know that much of mathematics then?? Can you explain it in a more simpler way ??
@mukeshreddy5778
@mukeshreddy5778 2 года назад
AT 17:45 I DIDNT UNDERSTAND HOW THE "START" CHANGED FROM 1 TO 3 I KNOW THAT IT SHOULD BE CHANGE BUT CANT SEEMS TO UNDERSTAND HOW IT CHANGED WRT LOGIC
@Flopsaurus
@Flopsaurus 2 года назад
Black magic I tell you! That was crazy how a simple rule can solve a seemingly complex problem. I would have spent hours trying to intuit some complex solution to this.
@jacksonwang3974
@jacksonwang3974 4 года назад
This is the visual version of CS Bible. A ton of respect and appreciation
@andresgonzalezaragon5689
@andresgonzalezaragon5689 4 месяца назад
The dominoes example is the best!
@ashokmahapatra7737
@ashokmahapatra7737 3 года назад
I need more time on this problem, but God this is so helpful...
@pankajbisht897
@pankajbisht897 3 года назад
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.
@baotran7626
@baotran7626 3 года назад
And Hanoi is the capital in Vietnam 🇻🇳. ( From a citizen )
@skeletor8250
@skeletor8250 3 года назад
My kid: We can make this problem more challenging by adding more disks. ME: We can make this more challenging by using fewer rods.
@cookiecakeeater6340
@cookiecakeeater6340 3 года назад
It took you several days to solve the three disks? It’s kind of hard but not that hard
@cotesworth922
@cotesworth922 3 года назад
Yeah it took me all of 45 seconds in my head. I have better than average spacial visualization but even with pen and paper someone should be able to work through all the stuff that doesn’t work in less than several days...
@cookiecakeeater6340
@cookiecakeeater6340 3 года назад
@@cotesworth922 well for five I could understand taking an hour at most but for three there’s a problem if it takes more than a few minutes
@user-wc1sm8cj8s
@user-wc1sm8cj8s 3 года назад
This problem really frustrates me for days
@jocelynchang183
@jocelynchang183 3 года назад
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!!!
@KunalSaini97
@KunalSaini97 2 года назад
Still can't understand xD
@pauljoneseyboy9615
@pauljoneseyboy9615 3 года назад
Excellent work
@altaroffire56
@altaroffire56 3 года назад
Sir, you have earned my subscription.
@swapnilnagar4710
@swapnilnagar4710 3 года назад
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!
@DK-ox7ze
@DK-ox7ze Год назад
Still don't understand why this works? What is basis for the assumption that solving for N-1 will solve for N?
@fangle0121
@fangle0121 4 года назад
Thank you so much! The animations are amazing to aid our understanding of this problem. :)
@Reducible
@Reducible 4 года назад
Thank you for the kind comment and I'm glad the animations were able to help with your understanding!
@marcusrokatis5192
@marcusrokatis5192 3 года назад
I used to solve this puzzle as it was not even allowed to move a bigger piece over a smaller one. Basically same problem that just takes a few more moves in order to solve it.
@codetech5598
@codetech5598 3 года назад
This video uses the rule that only a smaller disk can be placed over a larger disk.
@jayantverma6196
@jayantverma6196 4 года назад
This was so awesome man, i watched all of your videos and they are amazing. Big fan here!!!!!
@puspamadak
@puspamadak 3 года назад
I don't ever take the time to think of such hard problems. But your lessons gives me confidence. Thanks a lot!
@SaumyaSharma007
@SaumyaSharma007 3 года назад
Best Teacher Award goes to u Man..... Seriously best explanation I have ever seen 👌🔥🔥🔥🔥🔥
@akshatchaube1213
@akshatchaube1213 2 года назад
great explanation !
@heathledger7291
@heathledger7291 3 года назад
why dafuq so less views on such good content???
@c-wa
@c-wa 3 года назад
I've been watching this recursively, Any help How to exit?
@12jgy
@12jgy 3 года назад
Love this! I just recently discovered this channel through the FFT video (RU-vid 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!
@Joyddep
@Joyddep 3 года назад
I finally understood this problem after I understood this problem
@ace4x3
@ace4x3 2 года назад
Thanks, this is super good.
@DruthendraKommi
@DruthendraKommi 7 месяцев назад
Video might be old but concept is like advance clear... 😊
@Lallushe
@Lallushe 3 года назад
That's a quality video! Thank you!
@fairextl
@fairextl 3 года назад
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!
@rasati
@rasati 3 года назад
... does it ever specify that you have to move only 1 at a time?
@sparrrooww5473
@sparrrooww5473 7 месяцев назад
Very detailed and simple explanation. Keep up the good work
@kpunkt.klaviermusik
@kpunkt.klaviermusik 3 года назад
What amazes me most with this sort of programming is that the program doesn't know anything about the sizes of the discs. If the discs weren't already sorted by size at the beginning, the program would be completely unable to sort them.
@arielcavalcante8187
@arielcavalcante8187 3 года назад
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.
@akhilgupta3664
@akhilgupta3664 4 года назад
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 !!
@vijay6877
@vijay6877 3 года назад
now I'll try to solve it with loops rn I don't know if it is possible or not. but I'll try anyway. btw loved this video.
@johnmcaulay4348
@johnmcaulay4348 3 года назад
Great explanation and thanks to the ads I now have several passive income streams that will make me rich beyond my wildest dreams!
@rmatarrita
@rmatarrita 2 года назад
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!
@WisdomIsAwesome
@WisdomIsAwesome 3 года назад
I think this visualization can be made even better if the value of n(which is decreasing in every recursive subproblems), is also somehow represented in the respective animated subproblems. For e.g.: when the value of n decreases by one, the corresponding one disk can be made to look of the same color as the rod(so only those number of disks remained colored as the value of n) and also the value of n for the current subproblem must be mentioned there.
@Reducible
@Reducible 3 года назад
This is actually an interesting idea -- I had not thought about it while making the video. Thanks for sharing!
@RayanMADAO
@RayanMADAO 2 года назад
I'm too stupid for this ☹️
@Willrizzyourmom
@Willrizzyourmom 6 месяцев назад
No one is stupid, people don't know how to use 🧠 properly
@ProgressiveDeveloper
@ProgressiveDeveloper 8 месяцев назад
Even the Random Guessing would work, you just gave up to early.
@aviknayak9703
@aviknayak9703 3 месяца назад
Shut up that was the point of the video
@7aygames35
@7aygames35 3 года назад
Can you make a video on how you make these videos???
@Vextrove
@Vextrove 2 года назад
The puzzle is counterintuitive because you have to tediously rebuild the entire tower except without the bottom disk, which just feels wrong 🤣
@godofwinetits3826
@godofwinetits3826 4 года назад
next lecture, a chess game using recursion
@typingcat
@typingcat 10 месяцев назад
He: How crazy is this. My minds were blown away. Me: Meh. He: Do you even have a soul? Me: Eh.
@kamiosu
@kamiosu Год назад
5:30 was the moment of epiphany for me, thanks.
@lozD83
@lozD83 2 года назад
This one is Hanoi-ingly simple when you know how
@Simon_Alexnder
@Simon_Alexnder 3 года назад
criminally under-subbed
@gardenguster5271
@gardenguster5271 3 года назад
Its very weird too. If there's an odd number of discs the top disc moves left one (which would go to 3) and the 2nd disc goes to the right, and than the top disc goes left again. After this you simply move the smallest disc other than 1 and 2 to another space with a greater disc number (in this case 0 discs on a rod would be equivalent to the largest disc). This solves the puzzle with any odd number discs, and if you flip the order it solves for every even number. Theres some relationship between the number of rods and the number of times you move the top disc and the second disc, as three rods requires cycles of 3 moves of the top two to work, but cycles of 4 when there's 4 rods. Very strange.
@arithmós_0x8
@arithmós_0x8 3 года назад
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.
@CyberMew
@CyberMew 3 года назад
why is spooky sounds being played :(
@yasarekin
@yasarekin 3 года назад
oh hey it's the kotor korriban temple problem
@GhostyOcean
@GhostyOcean 3 года назад
Recursive problem solving seems suspiciously similar to proof by induction 😉
@phamcy
@phamcy Год назад
Madam Faruzan brings me here.
@adoq
@adoq Год назад
Same lol
@sathishraj1
@sathishraj1 4 года назад
Wonderful video! Can you make a video on Dijkstra algorithm on Graphs
@Reducible
@Reducible 4 года назад
Djisktra's algorithm will for sure be a video I release in the future :)
@sathishraj1
@sathishraj1 4 года назад
@@Reducible Thanks!!!
@andrewagita901
@andrewagita901 4 года назад
why do you have so little views and subs? you deserve more
@CptChen-qp3qf
@CptChen-qp3qf 2 года назад
This is AMAZING!!! Thank you so much explaining this complicated problem. But I have a question about what does the pm(start, end) do. I see someone asked the similar question before and I just copied his question again and hope someone can help me. Thanks a lot! ---I got lost at pm(1,2). Don't know which line of code is doing that and from there don't also know how start and end keep changing from their given values e.g: start is 1 but then it becomes 3 later on and I don't get where the change in value is coming from. Any form of help is explaining is appreciated
@NoorquackerInd
@NoorquackerInd 3 года назад
I'm more surprised that screwing with recursive fractal generation made me understand the whole thing _right_ when you showed how to do the 3-disk problem. Have I ascended?
@ManavMSanger
@ManavMSanger Год назад
Beautiful
@dkfactotum
@dkfactotum 2 года назад
Would be even cleaner if you express it as three recursive calls (moving biggest one is same as hanoi(1, start, end)) then the moving call is in just one place
@susantipsyhealy7655
@susantipsyhealy7655 5 месяцев назад
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
@neetusaxena7881
@neetusaxena7881 28 дней назад
Don't worry bro u can get more better ❤❤
Далее
5 Simple Steps for Solving Any Recursive Problem
21:03
Key to the Tower of Hanoi - Numberphile
14:07
Просмотров 430 тыс.
🦊🔥
00:16
Просмотров 396 тыс.
#kikakim
00:10
Просмотров 13 млн
Binary, Hanoi and Sierpinski, part 1
13:59
Просмотров 703 тыс.
Programming Loops vs Recursion - Computerphile
12:32
Просмотров 1,5 млн
The Bubble Sort Curve
19:18
Просмотров 583 тыс.
The ultimate tower of Hanoi algorithm
39:23
Просмотров 226 тыс.
🦊🔥
00:16
Просмотров 396 тыс.