Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type SparseUnionFind = IntMap Int
- newSUF :: SparseUnionFind
- emptySUF :: SparseUnionFind
- memberSUF :: Int -> SparseUnionFind -> Bool
- insertSUF :: Int -> SparseUnionFind -> SparseUnionFind
- fromListSUF :: [(Int, Int)] -> SparseUnionFind
- fromVecSUF :: Vector (Int, Int) -> SparseUnionFind
- rootSUF :: HasCallStack => Int -> SparseUnionFind -> (Int, Int)
- sameSUF :: HasCallStack => Int -> Int -> SparseUnionFind -> Bool
- unifySUF :: HasCallStack => Int -> Int -> SparseUnionFind -> SparseUnionFind
Documentation
type SparseUnionFind = IntMap Int #
@gotoki_no_joe. Vertex -> -size | root (negative if it's root)
\(O(1)\)
\(O(1)\)
memberSUF :: Int -> SparseUnionFind -> Bool #
\(O(\log N)\)
insertSUF :: Int -> SparseUnionFind -> SparseUnionFind #
\(O(\log N)\)
fromListSUF :: [(Int, Int)] -> SparseUnionFind #
\(O(E)\) From edges
fromVecSUF :: Vector (Int, Int) -> SparseUnionFind #
\(O(E)\) From edges
rootSUF :: HasCallStack => Int -> SparseUnionFind -> (Int, Int) #
\(O(\min(N, W))\) Returns (root, size)
sameSUF :: HasCallStack => Int -> Int -> SparseUnionFind -> Bool #
\(O(\min(N, W))\)
unifySUF :: HasCallStack => Int -> Int -> SparseUnionFind -> SparseUnionFind #
\(O(\min(N, W))\)