| 注册
首页|期刊导航|实验科学与技术|自底向上记录式 Hanoi 塔非递归算法

自底向上记录式 Hanoi 塔非递归算法

戴莉萍 黄龙军 刘清华

实验科学与技术2016,Vol.14Issue(1):51-54,81,5.
实验科学与技术2016,Vol.14Issue(1):51-54,81,5.DOI:10.3969/j.issn.1672-4550.2016.01.016

自底向上记录式 Hanoi 塔非递归算法

Non -Recursive Algorithm Based on Down -Up Record Method for Hanoi Tower

戴莉萍 1黄龙军 1刘清华1

作者信息

  • 1. 江西师范大学 软件学院,南昌 330022
  • 折叠

摘要

Abstract

The code of classical recursion algorithm for Hanoi tower problem is simple,but the time complexity is O(2n )and the code is difficult to understand.Understanding recursive idea of Hanoi tower problem and constructing a tree model based on the func-tion,two objectives of the function’s parameters and the execution result are analyzed carefully.Then the relationship between them is obtained and used to design a new down -up non -recursive algorithm.This algorithm here records the moving paths of n plates (n =1,2,…),which could be applied to get the moving result of n +1 plates directly.The experimental results show that the correspond-ing code is very easy to read,and its time complexity is only O(n),which is further practice and study for the non -recursive re-search of Hanoi tower problem.

关键词

Hanoi 塔问题/自底向上记录式/非递归算法/目标柱

Key words

Hanoi tower problem/down -up record/non -recursive algorithm/Visual Basic

分类

信息技术与安全科学

引用本文复制引用

戴莉萍,黄龙军,刘清华..自底向上记录式 Hanoi 塔非递归算法[J].实验科学与技术,2016,14(1):51-54,81,5.

基金项目

江西省自然科学基金项目(20132BAB201031)。 ()

实验科学与技术

1672-4550

访问量0
|
下载量0
段落导航相关论文