/*
*文件名称:1.pp
*作者:崔从敏
*完成日期:2015年12月20日
*问题描述:迷宫问题之图深度优先遍历解法
*/
#include <stdio.h>
#include <malloc.h>
#define MaxSize 100
#define M 4
#define N 4
//以下定义邻接表类型
typedef struct ANode //边的结点结构类型
{
int i,j; //该边的终点位置(i,j)
struct ANode *nextarc; //指向下一条边的指针
} ArcNode;
typedef struct Vnode //邻接表头结点的类型
{
ArcNode *firstarc; //指向第一条边
} VNode;
typedef struct
{
VNode adjlist[M+2][N+2]; //邻接表头节点数组
} ALGraph; //图的邻接表类型
typedef struct
{
int i; //当前方块的行号
int j; //当前方块的列号
} Box;
typedef struct
{
Box data[MaxSize];
int length; //路径长度
} PathType; //定义路径类型
int visited[M+2][N+2]= {0};
int count=0;
void CreateList(ALGraph *&a