文件名称:maze
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:33.79kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
用堆栈实现迷宫求解问题
基本思想:
若当前位置可以通过,则压入栈中,否则探求下一位置,若走不通,则回朔,迷宫大小:M*N.迷宫设置自定义。
求解迷宫问题的简单方法是:从入口出发,沿某一方向进行探索,若能走通,则继续向前走;否则沿原路返回,换一方向再进行探索,直到所有可能的通路都探索到为止。
为避免走回到已经进入的点(包括已在当前路径上的点和曾经在当前路径上的点),凡是进入过的点都应做上记号。-Maze with the stack to achieve the basic idea for solving the problem: If the current position can be adopted, in pressure, otherwise the next location to explore, if a dead end, then back to New Moon, the size of the maze: M* N. maze set up a custom. A simple maze to solve the problem is: starting from the entrance, along a certain direction to explore, can walk, then continue to move forward otherwise return along the same route, a direction for further exploration, until all possible pathways are exploring to date. In order to avoid going back to have access points (including the current path and current path in the point), all the points should be entered mark.
基本思想:
若当前位置可以通过,则压入栈中,否则探求下一位置,若走不通,则回朔,迷宫大小:M*N.迷宫设置自定义。
求解迷宫问题的简单方法是:从入口出发,沿某一方向进行探索,若能走通,则继续向前走;否则沿原路返回,换一方向再进行探索,直到所有可能的通路都探索到为止。
为避免走回到已经进入的点(包括已在当前路径上的点和曾经在当前路径上的点),凡是进入过的点都应做上记号。-Maze with the stack to achieve the basic idea for solving the problem: If the current position can be adopted, in pressure, otherwise the next location to explore, if a dead end, then back to New Moon, the size of the maze: M* N. maze set up a custom. A simple maze to solve the problem is: starting from the entrance, along a certain direction to explore, can walk, then continue to move forward otherwise return along the same route, a direction for further exploration, until all possible pathways are exploring to date. In order to avoid going back to have access points (including the current path and current path in the point), all the points should be entered mark.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
迷宫资料.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.