![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
邻接表
h_lizeming
这个作者很懒,什么都没留下…
展开
-
邻接表数组
转自:http://blog.csdn.net/wang2534499/article/details/47750321算法8:巧妙的邻接表(数组实现)之前我们介绍过图的邻接矩阵存储法,它的空间和时间复杂度都是N2,现在我来介绍另外一种存储图的方法:邻接表,这样空间和时间复杂度就都是M。对于稀疏图来说,M要远远小于N2。先上数据,如下。4 5 1 4 9 4 3 8 1 2 5 2...转载 2018-05-22 19:20:53 · 848 阅读 · 0 评论 -
匈牙利算法加邻接表
因为匈牙利算法存储边为二维数组,本人怕其空间超限,所#include <cstdio> #include <cstring> #include <cstdlib> using namespace std; int v[1000],u[1000],fir[1000],next[1000],f[1000],used[1000]; int n,m,bian; int ...原创 2018-05-22 19:56:08 · 391 阅读 · 0 评论