package containers-data
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=438a7bbcb789e116eead04c8a59641f0
sha512=b5551a9ebb9500e14482852c9294c9b4cc3df8153ba64b8e4c4de1dacbd0322ebe4a212316b308c94af562a40099c85b89a8415780cf4e2e0e519870f7342c1b
doc/containers-data/CCWBTree/module-type-S/index.html
Module type CCWBTree.SSource
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.