From the course: Python: Recursion

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Introduction to the Towers of Hanoi puzzle

Introduction to the Towers of Hanoi puzzle - Python Tutorial

From the course: Python: Recursion

Start my 1-month free trial

Introduction to the Towers of Hanoi puzzle

- {Narrator}The final topic in this chapter is the Towers of Hanoi, which is a Classic and famous puzzle. One of the things that makes it interesting from a computational point of view is that, if we had 64 disks, it's been said that a one move per second, that would take something like 585 billion years to complete the puzzle. Now we're going to start with a much smaller puzzle. Say three discs, much more achievable. This puzzle lends itself perfectly to occasion. Now, before continuing with this video you may want to find a version of this and play yourself just to get a feel for the puzzle. You may have a physical version, tucked away in the attic at home, or there's plenty of online versions. For example, the one I'm using here which we will provide a link for. The way this relates to recursion, is that we can solve a smaller version of our puzzle as part of the solution to the full puzzle. So let's say when we…

Contents