摘要: // 邻接表模板 // 头节点,next指针,节点值,结点总数 int h[N], nxt[N],to[N], tot; void add(int a, int b){ to[++tot]=b, nxt[tot]=h[a], h[a]=tot; // 先保存节点值 => 头插法 插入链表 } 阅读全文
posted @ 2024-08-11 10:17 Biang-Biang 阅读(11) 评论(0) 推荐(0)