Sumit Sahrawat, Maths & Computing, IIT (BHU) schreef op 19-2-2015 om 18:27:
What you did recursively is ...
  • Move (n - 1) from peg1 to peg3
  • Move 1 from peg1 to peg3
  • Move (n - 1) from peg1 to peg3
.. which is not what you want. Keep thinking, you will get it.
Some things to consider:
  • Distribute the discs on two intermediates.
  • Keep track of the order in which discs are assembled on the intermediates.

Thanks,

I thought I found a way of doing this so back to the drawing board.  :(

Roelof