问答题

图的邻接表的类型定义如下所示: #define MaxVertexNum 50 typedef struct node{ int adjvex; struct node*next; }EdgeNode; typedef struct{ VertexType vertex; EdgeNode*firstedge; }VertexNode; typedef VertexNode A djList[MaxVertexNum]; typedef struct{ AdjList adjiist; int n,e; }ALGraph; 为便于删除和插入图的顶点的操作,可将邻接表的表头向量定义为链式结构,两种定义的存储表示实例如下图所示,请写出重新定义的类型说明。

【参考答案】

typeclef struct ArcNode{ VNode*adjvex; //该弧所指向的顶点的位置 ......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)