用邻接表表示图
邻接表:G[N]为指针数组,对应矩阵每行一个链表,只存非0元素
typedef struct GNode *PtrToGNode;
struct GNode
{
int Nv;
int Ne;
AdjList G;
};
typedef PtrToNode LGraph;
typedef struct VNode
{
PtrToAdjVNode FirstEdge;
DataType Data;
}AdjList[MaxVertex];
typedef struct AdjVNode PtrToAdjVNode;
struct AdjVNode
{
Vertex V;
WeightType Weight;
PtrToAdjVNode Next;
};