Liking cljdoc? Tell your friends :D
Mostly clj/s.
Exceptions indicated.

nifty.disjoint-set


disjoint-setclj/s

(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
sourceraw docstring

DisjointSetcljs

source

IDisjointSetclj/sprotocol

canonicalclj/s

(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.

membersclj/s

(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

setsclj/s

(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

unionclj/s

(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.
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close