算法笔记__并查集

先给出源代码和输入输出测试结果: #include<iostream> using namespace std; const int N = 110; int father[N];//存放父亲节点 bool isBoot[N];//标记时否为根节点 int findFather(int x) { int a = x; while (x != father[x]) x = father[x]
相关文章
相关标签/搜索