有向图的简单路径.docVIP

  • 10
  • 0
  • 约4.57千字
  • 约 5页
  • 2016-03-28 发布于江苏
  • 举报
有向图的简单路径.doc

#include stdio.h #include malloc.h typedef int InfoType; #define MAXV 100 //最大顶点个数 //以下定义邻接矩阵类型 typedef struct { int no; //顶点编号 InfoType info; //顶点其他信息 } VertexType; //顶点类型 typedef struct //图的定义 { int edges[MAXV][MAXV]; //邻接矩阵 int vexnum,arcnum; //顶点数,弧数 VertexType vexs[MAXV]; //存放顶点信息 } MGraph; //图的邻接矩阵类型 //以下定义邻接表类型 typedef struct ANode //弧的结点结构类型 { int adjvex; //该弧的终点位置 struct ANode *nextarc; //指向下一条弧的指针 InfoType info; //该弧的相关信息,这里用于存放权值 } ArcNode; typedef int Vertex; typedef struct Vnode //邻接表头结点的类型 { Vertex

文档评论(0)

1亿VIP精品文档

相关文档