1.邻接矩阵法
#define MaxVertexNum 100
typedef char VertexType;
typedef int EdgeType;
typedef struct{
VertexType Vex[MaxVertexNum];
EdgeType Edge[MaxVertexNum][MaxVertexNum];
int vexnum,arcnum;
}MGraph;
2.邻接表法
#define MaxVertexNum 100
typedef struct ArcNode{
int adjvex;
struct ArcNode *next;
//InfoType info;
}ArcNode;
typedef struct VNode{
VertexType data;
ArcNode *first;
}VNode,AdjList[MaxvertexNum];
typedef struct{
AdjList vertices;
int vexnum,arcnum;
}ALGraph;