coins.backend.util
クラス UnionFind

java.lang.Object
  |
  +--coins.backend.util.UnionFind

public class UnionFind
extends java.lang.Object

Union-Find algorithm


コンストラクタの概要
UnionFind(int nelements)
          Create Union/Find data structure.
 
メソッドの概要
 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
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

UnionFind

public UnionFind(int nelements)
Create Union/Find data structure.

メソッドの詳細

find

public int find(int x)
Return the name of the set which x belongs to.


union

public int union(int x,
                 int y)
Merge two sets


isEquiv

public boolean isEquiv(int x,
                       int y)
Return true if x and y are members of the same set.