邻接表
来源:互联网 发布:d3.js demo显示 编辑:程序博客网 时间:2024/04/25 09:31
今天才发现临界表用错了,原来一直是无向图,所以随意怎么用,今天的有向 图才发现错了,纪念一下
void addedge(int a,int b,int c){edge[inde].s=b; edge[inde].cost=c;edge[inde].e=head[a];head[a]=inde++;}//这个是加权建立的
遍历
for(int i=head[u];i!=-1;i=edge[i].e){ int v=edge[i].s; }
‘’‘’‘’‘’‘’
0 1