|
|
|
|
|
|
|
Let's assume we can do this. Now, to move the next largest circle (circle 3) into place, we must move the two circles on top of it onto an auxiliary peg (peg 1 in this case): |
|
|
|
|
|
|
|
|
To get circle 2 into place, we must move circle 1 to another peg, freeing circle 2 to be moved to its place on peg 3: |
|
|
|
|
|
|
|
|
The last circle (circle 1) can now be moved into its final place, and we are finished: |
|
|
|
|
|
|
|
|
Notice that to free circle 4, we had to move three circles to another peg. To free circle 3, we had to move two circles to another peg. To free circle 2, we had to move one circle to another peg. This sounds like a recursive algo- |
|
|
|
|
|