![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
~~~~~~~图论~~~~~~~
Dunyb
坚毅
展开
-
Tarjan(总结)
1)求强联通分量 Tarjan求强联通分量2)缩点 Tarjan缩点3)求割点和桥 割点和桥的模板4)求双连通分量 待补...原创 2020-05-01 09:27:58 · 581 阅读 · 0 评论 -
链式前向星
一种数据结构存图方式理论知识:点击此处通用代码:存图 :const int MAXN = ;int head[MAXN], cnt = 1;bool vis[MAXN];struct Edge{ //根据需要+变量 int to, dis, next;}edge[MAXN << ];void add_edge(int u, int v, int di...原创 2020-04-09 14:07:25 · 310 阅读 · 0 评论 -
图(无向图代码)
/* 测试数据5 71 2 121 4 181 3 162 3 23 4 45 2 224 5 10*/#include <iostream>#include <cstring>#include <queue>#include<algorithm>using namespace std;typedef int Ve...原创 2019-03-01 17:21:42 · 1813 阅读 · 0 评论 -
图(有向图代码)
/* 测试数据5 71 2 121 4 181 3 162 3 23 4 45 2 224 5 10*/#include <iostream>#include <cstring>#include <queue>#include<algorithm>using namespace std;typedef int Ve...原创 2019-03-01 17:23:10 · 1452 阅读 · 0 评论 -
图 (Dijkstra)
有向图代码无向图代代码邻接矩阵比较简单就直接开一个二维数组就OK邻接表可以用vector,因为vector是个变长数组嘛,vector<int> Adj[N];可以设置出度邻接表,或者入度邻接表如果需要权值。那就弄个结构体嘛struct Node{ int v; //边的终点编号 int w; //边权 };vector<Node>...原创 2019-03-01 18:50:20 · 699 阅读 · 0 评论