并查集详解 void union_s( int xf, int yf) { p[yf]=xf; } int find(int x) { while (p[x]!=x) { x=p[x]; } return x; } 主要函数。