package orsetto
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=bb2af4d8b376b2d60fa996bd4d3b90d9f3559455672540f6d7c3598af81d483b
md5=f7bfa83013801b42fcdba607af2f012b
doc/orsetto.cf/Cf_sbheap/Heap/Create/index.html
Module Heap.Create
A functor to create a Heap module.
Parameters
module E : Cf_relations.OrderSignature
val nil : tThe empty heap.
val empty : t -> boolUse empty h to test whether h is empty.
val size : t -> intUse size h to compute the number of elements in h. Runs in O(n) time and O(log N) space.
Use head h to obtain the element on the top of the heap h. Raises Not_found if the heap is empty.
Use tail h to obtain the heap produced by discarding the element at the top of h. If h is the empty heap, then the empty heap is returned.
Use pop h to obtain the head and the tail of a heap h in one operation. Returns None if the h is empty.
Use put e h to obtain a new heap that is the result of inserting the element e into the heap h.
Use merge h1 h2 to obtain a new heap that is the result of merging all the elements of h1 and h2 into a single heap.
Use of_seq s to construct a heap from a sequence of elements. Evaluates the whole sequence. Runs in O(n) time and O(1) space.