Liking cljdoc? Tell your friends :D

engelberg.data.union-find


EMPTYclj

source

IUnionFindcljprotocol

A protocol for declaring connections between elements and querying status of connected components

A protocol for declaring connections between elements and querying status of connected components

componentclj

(component uf k)

Returns component containing key k, or nil if k is not present

Returns component containing key k, or nil if k is not present

componentsclj

(components uf)

Returns a sequence of the connected components

Returns a sequence of the connected components

connectclj

(connect uf key1 key2)

Returns new union-find data structure where key1 and key2 are connected

Returns new union-find data structure where key1 and key2 are connected

connected?clj

(connected? uf key1 key2)

Are key1 and key2 in the same connected component?

Are key1 and key2 in the same connected component?

contains-element?clj

(contains-element? uf k)

Is key k in uf?

Is key k in uf?

count-componentsclj

(count-components uf)

Returns number of connected components

Returns number of connected components

count-elementsclj

(count-elements uf)

Returns number of elements

Returns number of elements

elementsclj

(elements uf)

Returns a sequence of the elements

Returns a sequence of the elements
sourceraw docstring

union-findclj

(union-find)
(union-find & elements)

Constructor for the union-find data structure. Any arguments to the constructor will be added to the data structure as separate elements, initially disconnected from one another.

Constructor for the union-find data structure. Any arguments to the constructor will be added to the data structure as separate elements, initially disconnected from one another.
sourceraw docstring

UnionFindclj

source

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

× close