package batteries
A community-maintained standard library extension
Install
Dune Dependency
Authors
Maintainers
Sources
v3.9.0.tar.gz
md5=ea26b5c72e6731e59d856626049cca4d
sha512=55975b62c26f6db77433a3ac31f97af609fc6789bb62ac38b267249c78fd44ff37fe81901f1cf560857b9493a6046dd37b0d1c0234c66bd59e52843aac3ce6cb
doc/batteries.unthreaded/BatHeap/index.html
Module BatHeap
Source
Functional heaps over ordered types
Ascribes to:
BatEnum.Enumerable with type 'a enumerable = 'a t
Heap of elements that are compared with Pervasives.compare
.
Construction
add x h
is the same as insert h x
. This function is intended to be used with fold_right
.
Operations
Transformation
Build a heap from an enumeration. Consumes the enumeration. O(n log n)
Enumerate the elements of the heap in heap order. O(log n) per BatEnum.get
.
Printing
Source
val print :
?first:string ->
?last:string ->
?sep:string ->
('a, 'b) BatIO.printer ->
('a t, 'b) BatIO.printer
Print the contents of the heap in heap order. O(n log n)
Functorized version
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page