算法流程图
栈
队列
代码实现
#include<iostream>
#include<stack>
#include<queue>
using namespace std;
class Node
{
public:
Node(int a=0,int b=0,int c=0):x(a),y(b),di(c){
}
int x;
int y;
int di;
};
int map[15][15] = {
{
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, //示例迷宫,起点(1,1),终点(13,13)
{
1,0,1,1,1,1,1,1,1,1,1,1,1,1,1},
{
1,0,0,1,1,1,1,1,0,0,0,0,1,1,1},
{
1,1,0,1,1,1,1,1,0,1,1,0,1,1,1},
{
1,1,0,1,1,1,1,1