int adivex: struct EdgeNode *next: BEdgenodes typedef structⅤ exNode{/顶点结点 Entry lype item; EdgeNode*firstedge 3 exNode, AdjList MAX VERTEX NUMI; 创建有向图和无向图邻接表的算法实现: 请单鼠标左键换页!
int adjvex; struct EdgeNode *next; }EdgeNode; typedef struct VexNode{ //顶点结点 EntryType item; EdgeNode *firstedge; }VexNode,AdjList[MAX_VERTEX_NUM]; 创建有向图和无向图邻接表的算法实现:
(1)创建有向图邻接表 void Create adj(AdjList adj, int n) for(i=0;n;i++){∥初始化顶点数组 scanf(&adiliitem) adji]. firstedge=NULL scanf(&i,&;/输入弧 请单鼠标左键换页!
(1)创建有向图邻接表 void Create_adj(AdjList adj, int n) { for (i=0;i<n;i++){ //初始化顶点数组 scanf(&adj[i].item); adj[i].firstedge=NULL; } scanf(&i,&j); //输入弧