Liking cljdoc? Tell your friends :D

jordanlewis.data.union-find

Persistent disjoint set forests using Tarjan's union-find algorithm.

Persistent disjoint set forests using Tarjan's union-find algorithm.
raw docstring

DisjointSetForestcljprotocol

A data structure that maintains information on a number of disjoint sets.

A data structure that maintains information on a number of disjoint sets.

get-canonicalclj

(get-canonical this x)

Get the canonical element of an element. Return a vector of two elements: a new disjoint set forest that may have been modified due to the path compression optimization, and the canonical element of the input, or nil if no such element exists in the forest.

Get the canonical element of an element. Return a
vector of two elements: a new disjoint set forest that may have been modified
due to the path compression optimization, and the canonical element of the input, or
nil if no such element exists in the forest.

unionclj

(union this x y)

Union two sets. Return a new disjoint set forest with the sets that x and y belong to unioned.

Union two sets. Return a new disjoint set forest with the
sets that x and y belong to unioned.
raw docstring

IMutableUFNodecljprotocol

set-immutable!clj

(set-immutable! n)

set-parent!clj

(set-parent! n p)

set-rank!clj

(set-rank! n r)

IUFNodecljprotocol

mutable-node?clj

(mutable-node? n)

parentclj

(parent n)

rankclj

(rank n)

valueclj

(value n)

TransientDisjointSetForestcljprotocol

A data structure that maintains information on a number of disjoint sets.

A data structure that maintains information on a number of disjoint sets.

union!clj

(union! this x y)

Union two sets. Return a mutated disjoint set forest with the sets that x and y belong to unioned.

Union two sets. Return a mutated disjoint set forest with the
sets that x and y belong to unioned.
raw docstring

union-findclj

(union-find & xs)

Returns a new union-find data structure with provided elements as singletons.

Returns a new union-find data structure with provided elements as singletons.
raw docstring

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

× close