package containers
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=00ba20a8c8824991cab96aff8f8e5a3c
sha512=4126045d58b9408eecaaad005c334081ade151f291dafc32ce9a33e8f796d41f72df62b617528f272996f3c93cb9b4293545ab86ac416288960f5a2b60b41932
doc/containers/CCHeap/Make/index.html
Module CCHeap.MakeSource
Parameters
module E : PARTIAL_ORDSignature
filter p h filters values, only retaining the ones that satisfy the predicate p. Linear time at least.
take h extracts and returns the minimum element, and the new heap (without this element), or None if the heap h is empty.
delete_one eq x h uses eq to find one occurrence of a value x if it exist in the heap h, and delete it. If h do not contain x then it return h.
delete_all eq x h uses eq to find all x in h and delete them. If h do not contain x then it return h. The difference with filter is that delete_all stops as soon as it enters a subtree whose root is bigger than the element.
iter f h iterates over the heap h invoking f with the current element.
Conversions
to_list h returns the elements of the heap h, in no particular order.
to_list_sorted h returns the elements of the heap h in increasing order.
add_list h l adds the elements of the list l into the heap h. An element occurring several times will be added that many times to the heap.
add_seq h seq is like add_list. Renamed from add_std_seq since 3.0.
of_iter iter builds a heap from a given iter. Complexity: O(n log n).
of_seq seq builds a heap from a given Seq.t. Complexity: O(n log n). Renamed from of_seq since 3.0.
to_seq h returns a Seq.t of the elements of the heap h. Renamed from to_std_seq since 3.0.
to_iter_sorted h returns a iter by iterating on the elements of h, in increasing order.
to_seq_sorted h returns a Seq.t by iterating on the elements of h, in increasing order. Renamed from to_std_seq_sorted since 3.0.
to_string ?sep f h prints the heap h in a string using sep as a given separator (default ",") between each element (converted to a string using f).
val pp :
?pp_start:unit printer ->
?pp_stop:unit printer ->
?pp_sep:unit printer ->
elt printer ->
t printerpp ?pp_start ?pp_stop ?pp_sep ppf h prints h on ppf. Each element is formatted with ppf, pp_start is called at the beginning, pp_stop is called at the end, pp_sep is called between each elements. By defaults pp_start and pp_stop does nothing and pp_sep defaults to (fun out -> Format.fprintf out ",@ "). Renamed from print since 2.0