摘要:
//广度优先搜索实现求单源最短路径 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 = 阅读全文