//===DFS:深度优先遍历的递归算法=== void DFSM(ALGraph *G,int i) {//以Vi为出发点对邻接链表表示的图G进行DFS搜索 EdgeNode *p; printf("%c",G->adjlist[i].vertex); //访问顶点Vi visited[i]=TRUE; //标记Vi已访问 p=G->adjlist[i].firstedge; //取Vi边表的头指针 while(p) { //依次...
C语言版图的深度和广度优先遍历源代码 表示的图: #include"" #include"" #define MaxVertexNum 50 ertex=a; irstedge=NULL; irstedge; G->adjlist[i].firstedge=s; irstedge; G->adjlist[j].firstedge=s; ertex); irstedge; ertex); irstedge; ertex); //访问Vj...
C语言版图的深度和广度优先遍历源代码.doc,邻接表表示的图: #includestdio.h #includestdlib.h #define MaxVertexNum 50 //定义最大顶点数 typedef struct node{ //边表结点 int adjvex; //邻接点域 struct node *next; //链域 }EdgeNode; typedef struct vnode{ //顶点表