org.mindswap.pellet.utils
Class DisjointSet<T>

java.lang.Object
  extended by org.mindswap.pellet.utils.DisjointSet<T>

public class DisjointSet<T>
extends java.lang.Object

DisjointSet data structure. Uses path compression and union by rank.

Author:
Evren Sirin

Constructor Summary
DisjointSet()
           
 
Method Summary
 void add(T o)
           
 boolean contains(T o)
           
 java.util.Collection<T> elements()
           
 T find(T o)
           
 java.util.Collection<java.util.Set<T>> getEquivalanceSets()
           
 boolean isSame(T x, T y)
           
 java.lang.String toString()
           
 org.mindswap.pellet.utils.DisjointSet.Node<T> union(T x, T y)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DisjointSet

public DisjointSet()
Method Detail

add

public void add(T o)

contains

public boolean contains(T o)

elements

public java.util.Collection<T> elements()

find

public T find(T o)

getEquivalanceSets

public java.util.Collection<java.util.Set<T>> getEquivalanceSets()

isSame

public boolean isSame(T x,
                      T y)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

union

public org.mindswap.pellet.utils.DisjointSet.Node<T> union(T x,
                                                           T y)


Copyright © 2004 Evren Sirin. All Rights Reserved.