Class QuickUnion<T>


  • public class QuickUnion<T>
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      QuickUnion()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T id)  
      boolean exists​(T id)  
      T root​(T id)  
      void unite​(T id1, T... idList)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QuickUnion

        public QuickUnion()
    • Method Detail

      • add

        public void add​(T id)
      • exists

        public boolean exists​(T id)
      • root

        public T root​(T id)
        Throws:
        java.util.NoSuchElementException - if the parent of this node is null
      • unite

        public void unite​(T id1,
                          T... idList)