|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoins.backend.util.UnionFind
Union-Find algorithm
| Constructor Summary | |
UnionFind(int nelements)
Create Union/Find data structure. |
|
| Method Summary | |
int |
find(int x)
Return the name of the set which x belongs to. |
boolean |
isEquiv(int x,
int y)
Return true if x and y are members of the same set. |
int |
union(int x,
int y)
Merge two sets |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UnionFind(int nelements)
| Method Detail |
public int find(int x)
public int union(int x,
int y)
public boolean isEquiv(int x,
int y)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||