摘要: Kruskal算法求最小生成树(Minimun Cost Spanning Tree简称MST),使用的图的数据结构是边表数组。 阅读全文
posted @ 2016-03-13 14:53 robin_X 阅读(1835) 评论(0) 推荐(0) 编辑
摘要: Prim算法求图的最小生成树(使用的图的数据结构是图的邻接矩阵存储表示) /* minCost数组:该数组是结构数组,即每个元素是一个结构类型。该结构有两个域:lowCost用来保存所有已经在*最小生成树中的顶点,到所有还没有在最小生成树中的顶点的所有权值中的最小的;vertax域用 * 来保存是哪 阅读全文
posted @ 2016-03-13 14:48 robin_X 阅读(5376) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 4 #define MAX_VERTAX_SIZE 20 5 #define OK 1 6 #define ERROR 0 7 8 typedef int Status; 9 typedef char ElemType; 10 11 typedef struct EageNode{ 12 in... 阅读全文
posted @ 2016-03-13 14:41 robin_X 阅读(3252) 评论(0) 推荐(1) 编辑
摘要: 1 #include 2 #include 3 4 #define OK 1 5 #define ERROR 0 6 #define MAX_VERTAX_SIZE 20 7 8 typedef char VerElemType; 9 typedef char ElemType; 10 typedef int Status; 11 12 typed... 阅读全文
posted @ 2016-03-13 14:34 robin_X 阅读(2673) 评论(0) 推荐(0) 编辑