CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 其他小程序

文件名称:hanoi

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2015-11-13
  • 文件大小:
    547byte
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

由于汉诺塔移动的次数实在太多,神庙的和尚们决定偷懒。为了虔诚地偷

懒,他们用严格的语言描述了新的规则:

1. 有三根柱子,编号为0、1、2。初始状态下,0 号柱子从底向上按照从大

到小的次序依次放置了n 个金盘。

2. 每次移动将一根柱子最顶部的一个金盘移动到另一根柱子的最顶部。在整

个操作过程中,每根柱子上的最底部的金盘必须是最大的,而其他金盘的

顺序可以和大小无关。

3. 希望通过移动达到的目标状态是,2 号柱子从底向上按照从大到小的次序

依次放置这n 个金盘。

Figure1中的移动在新的规则下是合法的,总体的移动次数也从原规则下的

15 次减少到了13 次。

编写程序,用尽量少的移动次数解决懒和尚汉诺塔问题。-Because too many times to move the Tower of Hanoi, temple monks decided to be lazy. To piously lazy, they use strict language to describe a new rule: 1. There are three columns, numbered 0,1,2. Initially, the No. 0 column the bottom up in order of descending successively placed n gold plate. 2. Each movement will be a pillar of one of the top gold plate is moved to the top of the other pillars. Throughout the operation, the bottom of each column on a gold plate must be the biggest, but the order of the other gold discs can be independent of the size. 3. hopes to achieve the goal of moving the state is on the 2nd column the bottom up in order of descending place these n gold disc in order. Figure1 The move is legal under the new rules, the overall number of moves is also reduced 15 under the original rules to the 13 times. Programming, less exhausted the number of moves to solve the Towers of Hanoi problem lazy monk.
(系统自动生成,下载前可以参看下载内容)

下载文件列表

hanoi.cpp

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com