由汉诺塔游戏想到的汉诺塔简单非递归算法 |
| |
引用本文: | 张洪庆.由汉诺塔游戏想到的汉诺塔简单非递归算法[J].计算机与农业,2008(6):171-172. |
| |
作者姓名: | 张洪庆 |
| |
作者单位: | 黑龙江农业经济职业学院,黑龙江牡丹江157041 |
| |
摘 要: | 汉诺塔问题是一个古典的数学问题,也是程序设计中的经典递归问题,其递归算法由于简洁清晰,为大家所熟悉,编写出来的程序也比较简单,缺点是占用太多的内存空间。本文对汉诺塔问题进行了数学建模,并用几个简单的判断条件,对问题迅速求解,程序用C语言实现。
|
关 键 词: | 汉诺塔 非递归算法 数学建模 |
Hanoi simple non-recursive algorithm from the game of hanoi tower |
| |
Affiliation: | ZHANG Hong-qiang (Heilongjiang Agricultural Economy Vocational College, Mudanjiang 157041,China) |
| |
Abstract: | The Tower of Hanoi problem is not only a classical mathematical problem, but also a classic recursive problem for procedures design, because recursive algorithm, as we are familiar with it due to it's simple and clear, written by a relatively simple procedure with deficiency of taking up too much memory space. In this paper, the mathematical modeling of the Tower of Hanoi problem was built with C language, and the problem was solved using the judge with a few simple conditions quickly. |
| |
Keywords: | Tower of hanoi Non-recursive algorithms Mathematical modeling |
本文献已被 维普 等数据库收录! |
|