河内塔使用递归 [英] Tower of Hanoi using recursion

查看:67
本文介绍了河内塔使用递归的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对河内塔一无所知.我想使用递归为此编写一个程序.

I have no idea about Tower of Hanoi. I want to write a program on this using recursion.

推荐答案

来自 Wikipedia :

河内之塔或河内之塔 (也称为梵天塔) 是数学游戏或益智游戏.它 由三根杆和一个 不同大小的磁盘可以 滑到任何杆上.难题开始 磁盘整齐排列 一根杆的最大尺寸,最小为 顶部,从而制成圆锥形.

The Tower of Hanoi or Towers of Hanoi (also known as The Towers of Brahma) is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks neatly stacked in order of size on one rod, the smallest at the top, thus making a conical shape.

查看递归解决方案.

这篇关于河内塔使用递归的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆