一般我们写链式前向星是这样:
const int MAXN = 100001,MAXM = 1000001; struct Edge{ int to,nxt; }e[MAXM]; int head[MAXN],top; void add_edge(int a,int b){ e[++top].to = b; e[top].nxt=head[a]; head[a]=top; }
zhx好像说能用指针实现(比如说nxt是指向另一条边的指针,head是第一条边的指针),请问有没有巨佬有代码