11 2023 档案

DFS算法的非递归遍历分析
摘要:两种写法,一个是边表顶点号全部压栈,一个是类似后序非递归遍历 1、 void DFS(Graph G,int i) { int p,w; Stack S; InitStack(S); Push(S,i); visited[i]=true; while(!isEmpty(S)) { Pop(S,p); 阅读全文

posted @ 2023-11-27 22:27 四马路弗洛伊德 阅读(291) 评论(0) 推荐(0)

邻接矩阵
摘要:#include <stdio.h> #include <stdlib.h> #define MaxSize 20 typedef int VertexType; typedef int EdgeType; typedef int Elem ; typedef struct{ //邻接矩阵 Vert 阅读全文

posted @ 2023-11-26 22:17 四马路弗洛伊德 阅读(45) 评论(0) 推荐(0)

邻接表
摘要:#include <stdio.h> #include <stdlib.h> #define MaxSize 20 typedef int VertexType; typedef int EdgeType; typedef int Elem ; typedef struct{ //邻接矩阵 Vert 阅读全文

posted @ 2023-11-24 22:26 四马路弗洛伊德 阅读(50) 评论(0) 推荐(0)

导航