package grenier
A collection of various algorithms in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
grenier-v0.8.tbz
sha256=622a34f91f2787096f15786901b8d8cff528cada805b018fdbd522c00c6f13e8
sha512=e687e7c9e7b61d876c70570a9b6e4f3a497c8deb334e28532d8c2f9a2a06bff1330431b64ec3e8c4bcfcf2cc9495723339196608c6c4ac5a0699020d0af93e26
doc/grenier.baltree/Bt1/index.html
Module Bt1
val leaf : 'a t
Leaf constructor, the empty tree
Smart Node constructor, ensuring that the resulting tree is balanced and has the appropriate size.
Cost of node l x r
is expected to be O(log |size l
- size r
|) amortized, i.e proportional to the logarithm of the disbalance. In particular, if l
and r
are similarly-sized, it operates in constant time on average. NOT PROVEN
User-values can be moved in different subtrees of the result, but the ordering is preserved (so data stay correct if the operation applied on values is associative or the relation expected between them is transitive).
Convenience functions
val size : 'a t -> int
Accessor to the size
Concatenate two trees. Cost of join l r
is O(log (min size l
size r
)). NOT PROVEN
val rank : int -> 'a t -> 'a
Return the n'th node in tree order
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page