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

汉诺塔非递归算法研究
引用本文:赵东跃. 汉诺塔非递归算法研究[J]. 计算机应用与软件, 2008, 25(5): 241-243
作者姓名:赵东跃
作者单位:福州大学工程技术学院,福建,福州,350002
摘    要:
汉诺塔(Tower of Hanoi)问题是求在三个柱子之间移动圆盘的方法,它是递归程序设计的经典例子,已经证明其时间复杂度下限是O(2n),空间复杂度是O(n),实际使用时很容易溢出.给出汉诺塔问题的两个非递归算法:解集递推法和解集树法.解集递推法的时间复杂度和空间复杂度都是O(2n),该算法空间复杂度很大,无法实际使用,提出该算法的目的是为了引出解集树法.解集树法可以计算出指定的任意一步移动方法,时间复杂度和空间复杂度分别是O(n*2n)和O(1).并证明了汉诺塔问题的空间复杂度下限是O(1).

关 键 词:汉诺塔  递归算法  非递归算法
修稿时间:2006-07-24

NON-RECURSIVE ALGORITHMS FOR TOWER OF HANOI
Zhao Dong-yue. NON-RECURSIVE ALGORITHMS FOR TOWER OF HANOI[J]. Computer Applications and Software, 2008, 25(5): 241-243
Authors:Zhao Dong-yue
Affiliation:Zhao Dongyue(College of Engineering , Technology,Fuzhou University,Fuzhou 350002,Fujian,China)
Abstract:
Tower of Honoi problem as a classical instance of recursive programming was proved easy to overflow when run the algorithm with its time complexity lower limit being O(2n) and space complexity being O(n).Two non-recursive algorithms are discussed in this paper,they are Iterative Method and Tree Method of solution sets.Iterative Method was introduced just for the eduction of Tree Method because of its unpractical usage due to too large of its space complexity at O(2n),the same as its time complexity.Tree Met...
Keywords:Tower of hanoi Recursive algorithm Non-recursive algorithm  
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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