数据结构:链式前向星

链式前向星是一种相似邻接表,采用静态数组模拟链表的数据结构web 1、创建边结构体:数组 struct Edge { int to, cost, next }edge[maxn]; 创建数组head[]:head[i]存储以i为起点的第一条边的位置 开始时应初始化为-1数据结构 2、添加边函数:svg void add(int from, int to, int cost) { edge[co
相关文章
相关标签/搜索