Persistent disjoint set forests using Tarjan's union-find algorithm.
Persistent disjoint set forests using Tarjan's union-find algorithm.
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-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.
(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.
(set-immutable! n)
(set-parent! n p)
(set-rank! n r)
(mutable-node? n)
(parent n)
(rank n)
(value n)
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! 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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close