Class stl_DisjointSet

java.lang.Object
com.jackmeng.stl.stl_DisjointSet

public class stl_DisjointSet
extends java.lang.Object
  • Field Summary

    Fields
    Modifier and Type Field Description
    private int[] parent  
    private int[] rank  
  • Constructor Summary

    Constructors
    Constructor Description
    stl_DisjointSet​(int size)  
  • Method Summary

    Modifier and Type Method Description
    int find​(int x)  
    void union​(int x, int y)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • parent

      private final int[] parent
    • rank

      private final int[] rank
  • Constructor Details

    • stl_DisjointSet

      public stl_DisjointSet​(int size)
  • Method Details

    • find

      public int find​(int x)
    • union

      public void union​(int x, int y)