|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for a disjoint-set-union data structure from Chapter 21 of Introduction to Algorithms, Second edition.
Method Summary | |
java.lang.Object |
findSet(java.lang.Object x)
Returns the object that serves as the representative of the set containing an object. |
java.lang.Object |
makeSet(java.lang.Object x)
Makes a singleton set containing an object. |
void |
union(java.lang.Object x,
java.lang.Object y)
Unites two sets, identified by handles to objects in the sets. |
Method Detail |
public java.lang.Object makeSet(java.lang.Object x)
x
- The object in the singleton set.
public void union(java.lang.Object x, java.lang.Object y)
x
- Handle to an object in one set.y
- Handle to an object in the other set.public java.lang.Object findSet(java.lang.Object x)
x
- Handle to the object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |