标签:void code for struct 链表 int add head ++
struct edge{int u,v;edge *next;}*head[N],e[N];
head[N]->0 top->0
void add(int u,int v){
edge *p=&e[top++];
p->u=u;p->v=v;p->next=head[u];head[u]=p;
}
for(edge *p=head[1];p;p=p->next)
struct E{int next,to,w;};
E edge[N];
int head[N]->-1,cnt->1;
void add(int u,int v,int w)
{
edge[cnt].w=w;
edge[cnt].to=v;
edge[cnt].next=head[u];
head[u]=cnt++;
}
for(int i=head[k];~i;i=edge[i].next)
标签:void code for struct 链表 int add head ++
原文地址:http://blog.51cto.com/14093713/2342217