![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_数据结构
文章平均质量分 77
In_Youth
-青春
展开
-
ACM_邻接表
邻接表相连节点是插入链接的,不是顺序链接的(画图理解下面的代码,就能理解这句话的意思了)指针存无向图#include#include#includeusing namespace std;#define Max 100struct edge{ int v; struct edge *next;};//边结构,i j 之间有边,v存的值就是i或者j(无向图)原创 2015-07-20 14:59:14 · 556 阅读 · 0 评论 -
ACM_并查集
int find(int x)//递归+压缩路径{ return p[x] == x ? x : p[x] = find(p[x]);}int find(int x)// 朴素代码(没有压缩路径){ int y = x; while (ch[y] != y) y = ch[y]; return y;}int find(int x)//原创 2015-07-20 14:55:39 · 293 阅读 · 0 评论