The Tower of Hanoi - MATLAB Cody - MATLAB Central

Problem 186. The Tower of Hanoi

Difficulty:Rate

In the Tower of Hanoi problem with 3 rods (1, 2 & 3), the goal is to move a tower of disks from rod #1 to rod #2. You can move disks only one by one, on the rods. You can't put a disk on a smaller one.

At the beginning, all disks are on rod #1, biggest at the bottom, smallest at the top.

Give the number of moves necessary to solve the problem.

Solution Stats

64.53% Correct | 35.47% Incorrect
Last Solution submitted on Mar 12, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers369

Suggested Problems

More from this Author3

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page