Question:

What is the solution of problem of tours of hanoi?

by  |  earlier

0 LIKES UnLike

recursiviter

 Tags:

   Report

1 ANSWERS


  1. It's simple actually.

    The following solution is a simple solution for the toy puzzle.

    Alternate moves between the smallest piece and a non-smallest piece. When moving the smallest piece, always move it in the same direction (either to the left or to the right, but be consistent). If there is no tower in the chosen direction, move it to the opposite end. When the turn is to move the non-smallest piece, there is only one legal move

    http://www.cut-the-knot.org/recurrence/h...

    once you get the hang of this basic step, you'll be able to solve the puzzles with 6-7 discs.

    or you might want to check here

    http://en.wikipedia.org/wiki/Tower_of_Ha...

    edit: so you want it in MIPS assembly language. this is probably exactly what you were looking for:

    http://www.kernelthread.com/hanoi/html/s...

    and here's the same thing a little differently,

    http://www.kernelthread.com/hanoi/src/ha...

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.