package containers
Install
Dune Dependency
Authors
Maintainers
Sources
md5=d84e09c5d0abc501aa17cd502e31a038
sha512=8b832f4ada6035e80d81be0cfb7bdffb695ec67d465ed6097a144019e2b8a8f909095e78019c3da2d8181cc3cd730cd48f7519e87d3162442562103b7f36aabb
doc/containers.data/CCWBTree/module-type-S/index.html
Module type CCWBTree.S
Source
nth i m
returns the i
-th key, value
in the ascending order. Complexity is O(log (cardinal m))
.
get_rank k m
looks for the rank of k
in m
, i.e. the index of k
in the sorted list of bindings of m
. let (`At n) = get_rank k m in nth_exn n m = get m k
should hold.
update k f m
calls f (Some v)
if get k m = Some v
, f None
otherwise. Then, if f
returns Some v'
it binds k
to v'
, if f
returns None
it removes k
.
Map values, giving both key and value. Will use WORD.of_list
to rebuild keys.
split k t
returns l, o, r
where l
is the part of the map with keys smaller than k
, r
has keys bigger than k
, and o = Some v
if k, v
belonged to the map.
Like Map.S.merge
.
extract_min m
returns k, v, m'
where k,v
is the pair with the smallest key in m
, and m'
does not contain k
.
extract_max m
returns k, v, m'
where k,v
is the pair with the highest key in m
, and m'
does not contain k
.
Randomly choose a (key,value) pair within the tree, using weights as probability weights.