Towers of Hanoi using RECURSION TWICE!
Easy Theory
Here we look at the "Towers of Hanoi" problem, which involves using recursion twice. We have to move n cylinders of different sizes from one peg to another, utilizing a third one if necessary, and such that no "bigger" cylinder is on top of a smaller cylinder at any point. What we can do is to define inductive cases really easily, and then solve the whole problem by just relating the two recursive "moves" of n-1 cylinders to each other.
An example worked out is here: https://www.youtube.com/watch?v=svjqkfdhIQI
#easytheory #gate #theory
Contribute: Donation (appears on streams): https://streamlabs.com/easytheory1/tip Paypal: https://paypal.me/easytheory Patreon: https://www.patreon.com/easytheory Discord: https://discord.gg/SD4U3hs
Youtube Live Streaming (Sundays) - subscribe for when these occur.
Social Media: Facebook Page: https://www.facebook.com/easytheory/ Facebook group: https://www.facebook.com/groups/easytheory/ Twitter: https://twitter.com/EasyTheory
Merch: Language Hierarchy Apparel: https://teespring.com/language-hierarchy?pid=2&cid=2122 Pumping Lemma Apparel: https://teespring.com/pumping-lemma-for-regular-lang
If you like this content, please consider subscribing to my channel: https://www.youtube.com/channel/UC3VY6RTXegnoSD_q446oBdg?sub_confirmation=1
Gold Supporters: Micah Wood Silver Supporters: Timmy Gy
▶SEND ME THEORY QUESTIONS◀ ryan.e.dougherty@icloud.com
▶ABOUT ME◀ I am a professor of Computer Science, and am passionate about CS theory. I have taught many courses at several different universities, including several sections of undergraduate and graduate theory-level classes. ... https://www.youtube.com/watch?v=Hd0EekdmpKA
50707154 Bytes