Interface DisjointSetStruct

    • Method Detail

      • union

        void union​(long p,
                   long q)
        Joins the set of p (Sp) with set of q (Sq).
        Parameters:
        p - an item of Sp
        q - an item of Sq
      • setIdOf

        long setIdOf​(long nodeId)
        Find set Id of element p.
        Parameters:
        nodeId - the element in the set we are looking for
        Returns:
        an id of the set it belongs to
      • sameSet

        @Deprecated
        boolean sameSet​(long p,
                        long q)
        Deprecated.
        use only in tests
        Check if p and q belong to the same set.
        Parameters:
        p - a set item
        q - a set item
        Returns:
        true if both items belong to the same set, false otherwise
      • size

        long size()
        Number of elements stored in the data structure.
        Returns:
        element count
      • asNodeProperties

        default LongNodeProperties asNodeProperties()
        Wraps the DisjointSetStruct in an LongNodeProperties interface
        Returns:
        wrapped DisjointSetStruct