The Cyclic Towers of Hanoi
暂无分享,去创建一个
The famous Towers of Hanoi puzzle consists of 3 pegs (A, B, C) on one of which (A) are stacked n rings of different sizes, each ring resting on a larger ring. The objective is to move the n rings one by one until they are all stacked on another peg (B) in such a way that no ring is ever placed on a smaller ring; the other peg (C) can be used as workspace. The problem has tong been a favourite iir programming courses as one which admits a concise recursive solution. This solution hinges on the observation that, when the largest ring is moved from A to B, the n 1 remaining rings must all be on peg C. This immediately leads to the recursive procedure
[1] Patrick J. Hayes,et al. Discussion and correspondence A note on the Towers of Hanoi problem , 1977 .
[2] Peter Buneman,et al. The Towers of Hanoi Problem , 1980, Inf. Process. Lett..