#1
(由 Microsoft 翻译) 移动一大堆 n 件的技巧是将前 n - 1 件移动到另一个堆,然后将最后一块移动到目标堆,然后将 n - 1 件移动到目标堆。
要将 n - 1 件移动到其他堆,首先您需要移动前 n - 2 件,等等。
通常,如果要将奇数件移动到一堆,第一步是将第一件移动到该堆中;如果想要将奇数件移动到堆中,则第一步是将第一件移动到该堆中。如果你想把一个均匀的碎片移动到一堆,第一步是将第一块移动到另一个堆。
要将 n - 1 件移动到其他堆,首先您需要移动前 n - 2 件,等等。
通常,如果要将奇数件移动到一堆,第一步是将第一件移动到该堆中;如果想要将奇数件移动到堆中,则第一步是将第一件移动到该堆中。如果你想把一个均匀的碎片移动到一堆,第一步是将第一块移动到另一个堆。
(原文) Moving Large Piles in Tower of Hanoi
The trick to move a large pile of n pieces is to move the first n - 1 pieces to another pile, then move the last piece to the target pile, and then move the n - 1 pieces to the target pile.
To move the n - 1 pieces to the other pile, first you will need to move the first n - 2 pieces, and so on.
As a rule, if you want to move an odd number of pieces to a pile, the first step is to move the first piece to that pile; and if you want to move an even number of pieces to a pile, the first step is to move the first piece to another pile.
The trick to move a large pile of n pieces is to move the first n - 1 pieces to another pile, then move the last piece to the target pile, and then move the n - 1 pieces to the target pile.
To move the n - 1 pieces to the other pile, first you will need to move the first n - 2 pieces, and so on.
As a rule, if you want to move an odd number of pieces to a pile, the first step is to move the first piece to that pile; and if you want to move an even number of pieces to a pile, the first step is to move the first piece to another pile.
作者 Novel Games
2007-01-25 22:33:45
赞
回复