数据结构图的建立与计算.docVIP

  • 3
  • 0
  • 约1.54万字
  • 约 23页
  • 2017-03-22 发布于江苏
  • 举报
数据结构图的建立与计算

数据结构图的建立与计算 #includestdio.h #includestdlib.h #includemath.h #includemalloc.h #includestring.h #define NULL 0 #define INFINITY 2000 //权值很大,表示两顶点不相关联 #define MAX 20 //图顶点数目最大值 #define NameLength 20 //顶点名称字符串容许的最大字符个数 typedef enum{ DG,DN,UDG,UDN //{有向图,有向网,无向图,无向网} }Graphkind; typedef struct ArcCell{ int adj; //无权图,用1和0表示相邻否,对带权图,为权值 char *info; //该弧相关信息的指针 }ArcCell,AdjMatrix[MAX][MAX]; typedef struct{ char vexs[MAX][NameLength]; //顶点名称 AdjMatrix arcs; //邻接矩阵 int vexnum,arcnum; //图的当前顶点数和弧数 Graphkind kind;

文档评论(0)

1亿VIP精品文档

相关文档