#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
讚好
回覆