|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectMysteryDisjointSetsImplementation
public class MysteryDisjointSetsImplementation
A mysterious implementation of the Disjoin-Sets ADT!
| Constructor Summary | |
|---|---|
MysteryDisjointSetsImplementation(int N)
Constructs a disjoint-sets structure for N items, each of which initially belongs to its own subset (all labels are different). |
|
| Method Summary | |
|---|---|
int |
find(int i)
Returns the label of the subset containing item i. |
void |
union(int i,
int j)
Joins the subsets containing items i and j. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MysteryDisjointSetsImplementation(int N)
| Method Detail |
|---|
public int find(int i)
DisjointSets
find in interface DisjointSets
public void union(int i,
int j)
DisjointSets
union in interface DisjointSets
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||