|
jBNC Toolbox | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jbnc.graphs.DisjointSets
Maintains a collection of disjoint sets.
Coremen TH, Leiserson CE, Rivest RL. Introduction to Algorithms .
McGrow-Hill, 1990.
Field Summary | |
protected java.util.LinkedList |
sets
List of disjoint sets. |
Method Summary | |
java.lang.Object |
findSet(java.lang.Object x)
Returns a pointer to the representative of the (unique) set containing x . |
static void |
main(java.lang.String[] argv)
Test the class operation. |
void |
makeSet(java.lang.Object x)
Create a new set whose only member (and thus representative) is pointed by x . |
void |
union(java.lang.Object x,
java.lang.Object y)
Unites the dynamic sets that contain x and y , say S x and Sy , into a new set that is the union of these sets. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.LinkedList sets
Method Detail |
public static void main(java.lang.String[] argv)
argv
- Description of Parameterpublic void makeSet(java.lang.Object x) throws java.lang.Exception
x
- Description of Parameter
java.lang.Exception
- Description of Exceptionpublic void union(java.lang.Object x, java.lang.Object y) throws java.lang.Exception
x
- Description of Parametery
- Description of Parameter
java.lang.Exception
- Description of Exceptionpublic java.lang.Object findSet(java.lang.Object x)
x
- Description of Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |