08 2021 档案
摘要://广度优先搜索实现求单源最短路径 void BFSMINDISTANCE(AdjList G, int u) { InitQueue(&Q); for (int i = 0; i < G.vexnum; i++) { visited[i] = false; d[i] = INFINITY; pat
阅读全文
摘要:void DFS(AdjList G, int v0) { InitStack(&S); Push(&S, v0); while (!IsEmpty(S)) { Pop(&S, &v); if (!visited[v]) { visit(v); visited[v] = true; for (w =
阅读全文
摘要:1 #include "stdio.h" 2 #include "stdlib.h" 3 #define Max_vertex_num 20//顶点数目最大值 4 #define INFINITY 32768 5 typedef char VertexData;//顶点数据类型 6 typedef
阅读全文

浙公网安备 33010602011771号