链式前向星模板
void addedge(long long from,long long to,long long dis)//入邊鏈式前向星
{num_edge++;//編號edge[num_edge].next=head[from];//把next值改為此邊編號edge[num_edge].to=to;//to和dis分別為對應的終點和長度edge[num_edge].dis=dis;head[from]=num_edge;//把這個邊的始點的編號的head值改為前一個邊的編號(指向)
}
?
轉載于:https://www.cnblogs.com/gongcheng456/p/10776724.html
總結
- 上一篇: 两种方法判断一个字符串是否为另外一个字符
- 下一篇: iOS开发之地图