(disjoint-set)
(disjoint-set & xs)
Create a disjoint-set, a.k.a. union-find, data structure
Create a disjoint-set, a.k.a. union-find, data structure
(canonical this v)
Find the canonical value of the given value of the universe, i.e.
the find
in union-find.
Find the canonical value of the given value of the universe, i.e. the `find` in union-find.
(members this v)
Return the members of the set that shares the same canonical value as the given value
Return the members of the set that shares the same canonical value as the given value
(sets this)
Return a map of canonical values to the corresponding sets of values
Return a map of canonical values to the corresponding sets of values
(union this x y)
Union two values in the universe so that they share the same canonical
value, i.e. the union
in union-find. Do nothing if one of the values
does not belong to the universe.
Union two values in the universe so that they share the same canonical value, i.e. the `union` in union-find. Do nothing if one of the values does not belong to the universe.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close