Class DisjointSet<T>


  • public class DisjointSet<T>
    extends Object
    • Constructor Detail

      • DisjointSet

        public DisjointSet()
    • Method Detail

      • findAndUnion

        public boolean findAndUnion​(T node1,
                                    T node2)
        Returns:
        true if the specified equivalence is new
      • find

        public T find​(T element)
      • getEquivalentClasses

        public Collection<Set<T>> getEquivalentClasses()