nearest
function
Usage: (nearest coll test x)
(alpha)
Equivalent to, but more efficient than, (first (subseq* coll test x)),
where subseq* is clojure.core/subseq for test in #{>, >=} and
clojure.core/rsubseq for test in #{<, <=}.
Added in data.avl version 0.0.12
Source
rank-of
function
Usage: (rank-of coll x)
Returns the rank of x in coll or -1 if not present.
Added in data.avl version 0.0.6
Source
sorted-map
function
Usage: (sorted-map & keyvals)
keyval => key val
Returns a new AVL map with supplied mappings.
Added in data.avl version 0.0.1
Source
sorted-map-by
function
Usage: (sorted-map-by comparator & keyvals)
keyval => key val
Returns a new sorted map with supplied mappings, using the supplied
comparator.
Added in data.avl version 0.0.1
Source
sorted-set
function
Usage: (sorted-set & keys)
Returns a new sorted set with supplied keys.
Added in data.avl version 0.0.1
Source
sorted-set-by
function
Usage: (sorted-set-by comparator & keys)
Returns a new sorted set with supplied keys, using the supplied comparator.
Added in data.avl version 0.0.1
Source
split-at
function
Usage: (split-at n coll)
(alpha)
Equivalent to, but more efficient than,
[(into (empty coll) (take n coll))
(into (empty coll) (drop n coll))].
Added in data.avl version 0.0.12
Source
split-key
function
Usage: (split-key k coll)
(alpha)
Returns [left e? right], where left and right are collections of
the same type as coll and containing, respectively, the keys below
and above k in the ordering determined by coll's comparator, while
e? is the entry at key k for maps, the stored copy of the key k for
sets, nil if coll does not contain k.
Added in data.avl version 0.0.12
Source
subrange
function
Usage: (subrange coll test limit)
(subrange coll start-test start end-test end)
(alpha)
Returns an AVL collection comprising the entries of coll between
start and end (in the sense determined by coll's comparator) in
logarithmic time. Whether the endpoints are themselves included in
the returned collection depends on the provided tests; start-test
must be either > or >=, end-test must be either < or <=.
When passed a single test and limit, subrange infers the other end
of the range from the test: > / >= mean to include items up to the
end of coll, < / <= mean to include items taken from the beginning
of coll.
(subrange coll >= start <= end) is equivalent to, but more efficient
than, (into (empty coll) (subseq coll >= start <= end)).
Added in data.avl version 0.0.12
Source