请 解释以下这段代码

#include #include #include #define MAX_VERTEX_NUM 100 #define TRUE true #define FALSE false #define VerType CHAR_BIT typedef enum{DG,DN,UDG,UDN} Graphkind; typedef struct ArcNode { int adjvex; double weight; struct ArcNode *next; }ArcNode; typedef struct VNode { VertexType data; ArcNode *firstarc; }VNode,AdjList[MAX_VERTEX_NUM]; typedef struct ALGraph { AdjList vertices; int vexnum; int arcnum; int kind; }ALGraph; bool IsExist(ALGraph &G,int i,int j) { ArcNode *t; for(t=G.vertices[i].firstarc;t=t->next) { if(t->adjvex==j)return TRUE; } return FALSE; } int Create_adj(ALGraph &G) { int i,j,k; VerTexType tmp,a,b; ArcNode *s; G.kind=DG; for (k=0; i>tmp; for(i=0; i>a; cout<<"请输入一条弧头:"; cin>>b; i=LocateVexAL(G,a); j=LocateVexAL(G,b); //判断是否已经存在这条弧 if(i==j || IsExistArc(G,i,j)==TRUE) { k--; printf("请输入错误或该边已经存在,请重新输入!\n"); continue; } s=(ArcNode*)malloc(sizeof(ArcNode)); s->adjvex=j;; s->next=G.vertices[i].firstarc; G.vertices[i].firstarc=s; } } void output_adj(ALGraph &G) { int k; ArcNode *p; for (k=0;knext) { printf("%c",G.vvertices[p->adjvex].data); } printf("\n"); } } void main( )

用代码段贴出代码,这么乱糟糟的没法看。代码也不全。

貌似是图的内容,可能是入度里面的深度优先遍历