org.utgenome.util.repeat
Class DisjointSet<E>
java.lang.Object
org.utgenome.util.repeat.DisjointSet<E>
public class DisjointSet<E>
- extends Object
Union-Find disjoint set implementation
- Author:
- leo
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DisjointSet
public DisjointSet()
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.