文件名称:hannuota
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:7.33kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
算法思路:
1.如果只有一个金片,则把该金片从源移动到目标棒,结束。
2.如果有n个金片,则把前n-1个金片移动到辅助的棒,然后把自己移动到目标棒,最后再把前n-1个移动到目标棒.
3.单纯对于有N个金片要挪动的步数求出, 可以使用递推方法,满足递推方程f(i) = f(i - 1) * 2 + 1-Algorithm idea: 1. If there is only a gold film, while the gold from the source to the target mobile wand, The End. 2. If there are n gold films, while the former n-1 gold piece to move to the auxiliary rod, and then move to the goal of their own stick, then the last n-1 before moving to the target rod. 3. Simply to have N a gold piece to move step calculated, you can use recursive methods to meet the recursive equation f (i) = f (i- 1)* 2+ 1
1.如果只有一个金片,则把该金片从源移动到目标棒,结束。
2.如果有n个金片,则把前n-1个金片移动到辅助的棒,然后把自己移动到目标棒,最后再把前n-1个移动到目标棒.
3.单纯对于有N个金片要挪动的步数求出, 可以使用递推方法,满足递推方程f(i) = f(i - 1) * 2 + 1-Algorithm idea: 1. If there is only a gold film, while the gold from the source to the target mobile wand, The End. 2. If there are n gold films, while the former n-1 gold piece to move to the auxiliary rod, and then move to the goal of their own stick, then the last n-1 before moving to the target rod. 3. Simply to have N a gold piece to move step calculated, you can use recursive methods to meet the recursive equation f (i) = f (i- 1)* 2+ 1
(系统自动生成,下载前可以参看下载内容)
下载文件列表
汉诺塔/汉诺塔.cpp
汉诺塔/汉诺塔.dsp
汉诺塔/汉诺塔.dsw
汉诺塔/汉诺塔.ncb
汉诺塔/汉诺塔.opt
汉诺塔/汉诺塔.plg
汉诺塔/Debug
汉诺塔
汉诺塔/汉诺塔.dsp
汉诺塔/汉诺塔.dsw
汉诺塔/汉诺塔.ncb
汉诺塔/汉诺塔.opt
汉诺塔/汉诺塔.plg
汉诺塔/Debug
汉诺塔
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.