Package com.complexible.common.collect

# Class DisjointSet<T>

java.lang.Object
com.complexible.common.collect.DisjointSet<T>

public class DisjointSet<T> extends Object
Disjoint set data structure. A disjoint set Uses path compression and union by rank.

Author:
  Evren Sirin

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DisjointSet()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(T o)`
  `boolean`
  `contains(T o)`
  `Collection<T>`
  `elements()`
  `T`
  `find(T o)`
  `Collection<Set<T>>`
  `getEquivalanceSets()`
  `boolean`
  `isSame(T x, T y)`
  `String`
  `toString()`
  `com.complexible.common.collect.DisjointSet.Node<T>`
  `union(T x, T y)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DisjointSet

    public DisjointSet()

- ## Method Details

  - ### add

    public void add(T o)

  - ### contains

    public boolean contains(T o)

  - ### elements

    public Collection<T> elements()

  - ### find

    public T find(T o)

  - ### getEquivalanceSets

    public Collection<Set<T>> getEquivalanceSets()

  - ### isSame

    public boolean isSame(T x, T y)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### union

    public com.complexible.common.collect.DisjointSet.Node<T> union(T x, T y)