package grenier
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8fd22abf9f4589c206008654fa9eebb1cf4a58737ebb34138c6709520f36b75f
sha512=f60315eccfecaec9cb4c3bd020ef6f94d05ed6b13038109b904ead6e4e5662f4ed95415855b3c763293b762b696f1962045393fd592742d54cf5607d0ef2961a
doc/grenier.baltree/Mbt/Make/index.html
Module Mbt.MakeSource
Parameters
Signature
type +'a t = private | Leaf| Node of int * 'a t * 'a M.measurable * 'a t * M.measure(*Node(size, l, x, r)where:sizeis the number of elements in the tree,lis the left sub-treexis a user-defined valueris the right sub-tree.
Trees are guaranteed balanced by construction, the depth of all branches is O(log
*)size).
Type of balanced trees
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
Concatenate two trees. Cost of join l r is O(log (min size l size r)). NOT PROVEN
Return the n'th node in tree order