#define ERROR 0
#define OK 1
#define Overflow 2
#define Underflow 3
#define NotPresent 4
#define Duplicate 5
typedef int ElemType;
typedef struct
{
ElemType **a; //邻接矩阵
int n; //图的当前顶点数
int e; //图的当前边数
ElemType noEdge; //两顶点间无边时的值
}mGraph;
typedef struct //建立队列
{
int front;
int rear;
int maxSize;
ElemType *element;
}Queue;
typedef int Status;
Status Init (mGraph *mg,int nSize,ElemType noEdgeValue)
{
int i,j;
mg->n=nSize; //初始化顶点数
mg->e=0; //初始时没有边
mg->noEdge=noEdgeValue; //初始化没有边时的取值
mg->a=(ElemType**)malloc(nSize*sizeof(ElemType*)); //生成长度为n的一维指针数组
if(!mg->a)
return ERROR;
for(i=0;i<mg->n;i++) //动态生成二维数组