Towers of Hanoi

Computer ScienceAlgorithms & Problem SolvingCommunity

Loading…

Share ✨ Customize with AI Report a problem

Learn recursion by solving the Towers of Hanoi. Watch the call stack grow and shrink automatically, or try to solve it yourself by dragging the discs.

Lesson: The Towers of Hanoi is a classic recursive algorithm. To move N discs from peg A to peg C: recursively move N-1 discs to peg B, move the largest disc to peg C, and finally move N-1 discs from peg B to peg C. The minimum number of moves required is 2^N - 1.

Created by a teacher with Simulic AI and reviewed by the Simulic team.

How to use

Parameters you can change

  • Mode Auto (Call Stack Trace), Manual (Drag & Drop)
  • Number of Discs 1–8
  • Animation Speed 1–10