随笔分类 - 图
图中点的层次
摘要:https://www.acwing.com/problem/content/849/ 本题为经典的图形插入遍历题目 首先是手写链表 实现 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #i
阅读全文
邻接表 存储 vector
摘要:图的建立有两种,邻接矩阵和邻接表。 邻接矩阵适用于图较为密集,(稀疏图太浪费存储空间了),图如果较为稀疏,则使用邻接表为宜,dijkstra算法就是以邻接表为基础的。 有向无权图 #include<iostream> #include <vector> #include <algorithm> #i
阅读全文