摘要
本文将利用迷宫问题作为实例,首先给出了走迷宫的问题描述;其次对网格状迷宫利用二维数组进行存储,模拟出走迷宫时行进方向的回溯法探测过程;最后利用C++编程语言给出了解决迷宫问题的递归算法和非递归算法。最终在迷宫中找到一条最佳路径。
This paper will use the maze problem as an example, the first description of maze problem is given; secondly to store grid maze using two-dimensional array, analog backtracking maze detection process from the direction of travel;finally,the C++ programming language provides a recursive algorithm to solve the maze problem and non-recursive algorithm using. Finally found an optimal path in a maze.
出处
《电子测试》
2013年第7X期171-172,共2页
Electronic Test
关键词
迷宫问题
二维数组
回溯法
最佳路径
Maze problem
Two-dimensional array
Backtracking
An optimal path