package grenier
A collection of various algorithms in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
grenier-v0.11.tbz
sha256=658e1ad6fc5fdce0871975b3ebcb3ec760248be63cdb9ea965e3121cc7478d77
sha512=d9ff83f1b025f34c22af5921444993df219761dcee8d8cb5a940f266df8677278967434b22314c5c82d5d983e4c94c04cd52c4717d5c1f22fbd3a022631fae1c
doc/grenier.orderme/Order_managed_interval/index.html
Module Order_managed_interval
Source
Basic ordering operations
An element of an ordering.
after t
inserts a new element to the ordering, greater than t
but less than all existing elements greater than t
.
O(1) amortized.
before t
inserts a new element to the ordering, less than t
but greater than all existing elements less than t
.
O(1) amortized.
Compare two elements. O(1)
Memory management
When you know you are not going to use an element any longer, forget
it to release memory. It makes operations slightly faster to not have to wait for the GC to release elements.
After calling forget
, an element should not be used. You can check if it is the case with is_valid
.
Algorithm due to: Two Simplified Algorithms for Maintaining Order in a List Bender et al., 2002
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page