首页 | 本学科首页   官方微博 | 高级检索  
     


The towers of Hanoi revisited: Moving the rings by counting the moves
Authors:T.R. Walsh
Affiliation:Dept. of Computer Science, University of Western Ontario, London, Ontario, N6A 3K7 Canada
Abstract:A non-recursive algorithm, distinct from the one already in the literature, is presented for solving the n-ring Towers of Hanoi problem in the minimum 2n?1 moves. In addition, a simple relation is found between the binary representation of k and the position of the rings after k moves, allowing either to be obtained from the other in O(n) operations. Thus the position of the rings can be effectively stored in a work of n bits.
Keywords:Towers of Hanoi  iterative algorithms
本文献已被 ScienceDirect 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号