邻接矩阵表示如下:
typedef struct
{
int no;
char info;
}VertexType;
typedef struct
{
int edges[maxSize][maxSize];
int n,e;
VertexType vex[maxSize];
}MGraph;
邻接表表示如下:
typedef struct ArcNode
{ int adjvex; struct ArcNode *nextarc; int info;}ArcNode;typedef struct VNode{ char data; ArcNode *firstatc;}VNode;typedef struct{ VNode adjlist[maxSize]; int n,e;}AGraph;
posted on 2012-08-30 22:40
yyj 阅读(187)
评论(0) 编辑 收藏 引用