链式前向星存图

Posted DaWeiGuo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了链式前向星存图相关的知识,希望对你有一定的参考价值。

typedef struct item{
    int to;
    int next;
    int w;
}Item;
Item E[MAXN];

void addEdge(int u,int v,int w){
    E[cnt].to = v;
    E[cnt].w = w;
    E[cnt].next = head[u];
    head[u] = cnt++;
}
“热爱是所有的理由和答案”。

以上是关于链式前向星存图的主要内容,如果未能解决你的问题,请参考以下文章

最短路 spfa 算法 && 链式前向星存图

数据结构前向星存图

图的存储:链式前向星(边集数组)

模板链式前向星

hdu-3790最短路刷题

ACM模板——链式前向星&&邻接表存图