org.utgenome.util.repeat
Class DisjointSet<E>

java.lang.Object
  extended by org.utgenome.util.repeat.DisjointSet<E>

public class DisjointSet<E>
extends Object

Union-Find disjoint set implementation

Author:
leo

Constructor Summary
DisjointSet()
           
 
Method Summary
 void add(E element)
           
 List<E> disjointSetOf(E x)
           
 int find(E x)
          Find the disjoint set ID of the given element
 int numElements()
           
 Set<E> rootNodeSet()
           
 void union(E x, E y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisjointSet

public DisjointSet()
Method Detail

add

public void add(E element)
Parameters:
element -

rootNodeSet

public Set<E> rootNodeSet()

disjointSetOf

public List<E> disjointSetOf(E x)

union

public void union(E x,
                  E y)

numElements

public int numElements()

find

public int find(E x)
Find the disjoint set ID of the given element

Parameters:
x - element
Returns:


Copyright © 2007-2012 utgenome.org. All Rights Reserved.