2016年11月3日

图的遍历

摘要: /* 邻接表存储的图 - DFS */ void Visit( Vertex V ) { printf("正在访问顶点%d\n", V); } /* Visited[]为全局变量,已经初始化为false */ void DFS( LGraph Graph, Vertex V, void (*Visit)(Vertex) ) { /* 以V为出发点对邻接表存储的图Graph进行... 阅读全文

posted @ 2016-11-03 18:01 SijingLin 阅读(124) 评论(0) 推荐(0) 编辑

图的邻接表表示法

摘要: /* 图的邻接表表示法 */ #define MaxVertexNum 100 /* 最大顶点数设为100 */ typedef int Vertex; /* 用顶点下标表示顶点,为整型 */ typedef int WeightType; /* 边的权值设为整型 */ typedef char DataType; /* 顶点存储的数据类型设... 阅读全文

posted @ 2016-11-03 16:48 SijingLin 阅读(173) 评论(0) 推荐(0) 编辑

* 图的邻接矩阵表示法 */

摘要: * 图的邻接矩阵表示法 */ #define MaxVertexNum 100 /* 最大顶点数设为100 */ #define INFINITY 65535 /* ∞设为双字节无符号整数的最大值65535*/ typedef int Vertex; /* 用顶点下标表示顶点,为整型 */ typedef int WeightType; /*... 阅读全文

posted @ 2016-11-03 16:47 SijingLin 阅读(163) 评论(0) 推荐(0) 编辑

导航