9.1.并查集介绍

9.1并查集介绍

1.并查集的接口

1
2
3
4
5
6
7
public interface DisjointSets {
/** connects two items P and Q */
void connect(int p, int q);

/** checks to see if two items are connected */
boolean isConnected(int p, int q);
}