struct arcnode
{
int adjvex;
arcnode *nextarc;
};
struct adjlist
{
int data;
arcnode *firstarc;
};
#define max 10
#include<stdio.h>
#include<malloc.h>
int main()
{
adjlist a[6];
int j;
for(j=0;j<6;j++)
a[j].firstarc=NULL;
arcnode *p=(arcnode*)malloc(sizeof(arcnode));
p->adjvex=1;
p->nextarc=NULL;
arcnode *p1=(arcnode*)malloc(sizeof(arcnode));
p1->adjvex=2;
p1->nextarc=NULL;
a[0].data=0;
a[0].firstarc=p;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余4页未读,立即下载