//邻接表--->邻接矩阵
void Convert(Graph G,&int A[n][n]){
for(int i=0;i<n;i++){
for(p=G.vexnum[i].firstarc;p;p=p->nextarc){
A[i][p->adjvex]=1;
}
}
}
//邻接矩阵--->邻接表
void Convert(int A[n][n],Graph &G){
ArcNode *p;
G=(Graph*)malloc(sizeof(Graph));
for(int i=0;i<n;i++){
G->adjlist[i].firstarc = NULL;
}
for(int i=0;i<n;i++){
for(int j=n;j>=0;j--){
p=(ArcNode*)malloc(sizeof(ArcNode));
if(A[i][j]!=0){
p->next=G.vexnum[i]->next;
G.vexnum[i]->first=p
p->weight=A[i][j];
p->adjvex=j;
}
}
}
}