文件名称:migonglaoshu
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.69kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
数据结构,迷宫老鼠问题求解
迷宫是一个矩形区域,它有一个入口和一个出口。在迷宫的内部包含不能穿越的墙或障碍。迷宫的入口在左上角,出口在右下角。假定用n*m的矩阵来描述迷宫,位置(1,1)表示入口,(n,m)表示出口,n和m分别代表迷宫的行数和列数。迷宫中的每个位置都可用其行号和列号来指定。在矩阵中,当且仅当在位置(i,j)处有一个障碍时其值为1,否则其值为零。(即0表示能通过,1 表示不能通过。)现假设老鼠从左上角[1,1]进入迷宫,编写算法,寻求一条从右下角[m,n] 出去的路径。
迷宫老鼠问题是一个典型的可以用栈进行求解的问题。题目要求我们首先构造一个可主动输入维数但随机生成的迷宫,用栈的知识讲老鼠每走一步都记录下来,并利用入栈出栈进行出迷宫的路径寻找。
-Data structures, maze mouse problem solving maze is a rectangular area, it has an entrance and an exit. Contains in the maze of internal walls or obstacles that can not be crossed. Maze entrance in the upper left corner of the exports in the lower right corner. Is assumed that a matrix of n* m to describe the labyrinth, represented by the position (1,1) inlet, (n, m) said outlet, n and m respectively represent the number of rows and number of columns of the maze. Each position are available in the maze of its row and column numbers specified. In the matrix, when and only when in the position (i, j) at an obstacle when its value is 1, otherwise its value is zero. (Ie 0 means pass, 1 can not.) It is assumed that the mouse from the top left corner [1,1] into the maze, write algorithms to seek a path out from the lower right corner [m, n]. Maze mice is a typical can solve the problem with a stack. The subject requirements we first constructed an active input dimension but randomly generate
迷宫是一个矩形区域,它有一个入口和一个出口。在迷宫的内部包含不能穿越的墙或障碍。迷宫的入口在左上角,出口在右下角。假定用n*m的矩阵来描述迷宫,位置(1,1)表示入口,(n,m)表示出口,n和m分别代表迷宫的行数和列数。迷宫中的每个位置都可用其行号和列号来指定。在矩阵中,当且仅当在位置(i,j)处有一个障碍时其值为1,否则其值为零。(即0表示能通过,1 表示不能通过。)现假设老鼠从左上角[1,1]进入迷宫,编写算法,寻求一条从右下角[m,n] 出去的路径。
迷宫老鼠问题是一个典型的可以用栈进行求解的问题。题目要求我们首先构造一个可主动输入维数但随机生成的迷宫,用栈的知识讲老鼠每走一步都记录下来,并利用入栈出栈进行出迷宫的路径寻找。
-Data structures, maze mouse problem solving maze is a rectangular area, it has an entrance and an exit. Contains in the maze of internal walls or obstacles that can not be crossed. Maze entrance in the upper left corner of the exports in the lower right corner. Is assumed that a matrix of n* m to describe the labyrinth, represented by the position (1,1) inlet, (n, m) said outlet, n and m respectively represent the number of rows and number of columns of the maze. Each position are available in the maze of its row and column numbers specified. In the matrix, when and only when in the position (i, j) at an obstacle when its value is 1, otherwise its value is zero. (Ie 0 means pass, 1 can not.) It is assumed that the mouse from the top left corner [1,1] into the maze, write algorithms to seek a path out from the lower right corner [m, n]. Maze mice is a typical can solve the problem with a stack. The subject requirements we first constructed an active input dimension but randomly generate
(系统自动生成,下载前可以参看下载内容)
下载文件列表
迷宫老鼠/migonglaoshu.C
迷宫老鼠
迷宫老鼠
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.