com.ibm.wala.util.intset
Class IntegerUnionFind

java.lang.Object
  extended by com.ibm.wala.util.intset.IntegerUnionFind

public class IntegerUnionFind
extends java.lang.Object

An implementation of Tarjan's union-find, using path compression and balancing, for non-negative integers


Constructor Summary
IntegerUnionFind()
           
IntegerUnionFind(int size)
           
 
Method Summary
 int find(int x)
           
 int size()
           
 void union(int x, int y)
          union the equiv classes of x and y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerUnionFind

public IntegerUnionFind()

IntegerUnionFind

public IntegerUnionFind(int size)
Parameters:
size - initial size of the tables
Method Detail

union

public void union(int x,
                  int y)
union the equiv classes of x and y


find

public int find(int x)
Parameters:
x -
Returns:
representative of x's equivalence class

size

public int size()