矩阵:
typedef vertex { int no; int info; }vertextype; typedef struct { int edges[maxn][maxn]; int n,e; vertextype vexs[maxn]; }matgraph;
邻接表:
typedef struct anode { int adjvex; int weight; node *nextarc; }arcnode; typedef struct { int info; arcnode *firstarc; }vnode; typedef struct { int adjlist[maxn]; int n,e; }adjgraph;