posts - 0,comments - 0,trackbacks - 0
邻接矩阵表示如下:

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)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航:   博客园   博客园最新博文   博问   管理