十字链表
2017-05-15 13:12:56 1 举报
十字链表
作者其他创作
大纲/内容
scanf_s(\"%d\
T
tmp = (Arc *)malloc(sizeof(Arc));
F
输入chose
k num_arc;
printf(\"请依次输入结点名称\\");
g-nlist[i].firstin = g-nlist[i].firstout = NULL;i++
scanf_s(\"%d-%d\
k++
其他
NULL == tmp
printf(\"分配空间失败,请重试!\\");
scanf_s(\"%d %d\
chsoe==1
int chose;Graph shiyan;
k=0
printf(\"第%d个:\
i num_node;
printf(\"请输入边【请输入结点对应的下标,从0开始,格式:“x”-“y”,如:1-2 】\\");
printf(\"请输入给定的数字!\\");
tmp-node_arctail = i;\t\t\ttmp-node_archead = j;\t\t\ttmp-arct = g-nlist[i].firstout;\t\t\ttmp-arch = g-nlist[j].firstin;\t\t\tg-nlist[i].firstout = tmp;\t\t\tg-nlist[j].firstin = tmp;
printf(\"请输入顶点数与边数【空格隔开】!\\");
CreateGraph(&shiyan);
void CreateGraph(Graph *g)
printf(\"请输入第%d个边:\
i = 0
0 条评论
下一页