摘要:
#include<stdio.h>#include<stdlib.h>#define N 30000#define M 500int rank[N], father[N],num[N]; /* rank指代数的层数,num指每个节点数目 */ int Make_set(int x) /* 初始化父节点 */{ int i; for (i=0; i<x; i++) { father[i] = i; rank[i] = 0; num[i] = 1; }}int Find_set(int x) /* 寻找父节点,运用递归查找 */{ if (x != father[x] 阅读全文