Module Leftist.Make

(Make (M) (OT)) is a leftist min- or max-heap on the ordered type OT; see S; (Make (Min) (OT)) is a min-heap on OT, while (Make (Max) (OT)) is a max-heap on OT.

Parameters

module M : MinMax
module Ord : OrderedType

Signature

type elt = Ord.t
type t
val empty : t
val singleton : elt -> t
val merge : t -> t -> t
val insert : elt -> t -> t
val push : elt -> t -> t
val get : t -> elt
val delete : t -> t
val pop : t -> elt * t
val fold : (elt -> 'a -> 'a) -> 'a -> t -> 'a
val iter : (elt -> unit) -> t -> unit
val to_list : t -> elt list
val of_list : elt list -> t
val random : ?size:(unit -> int) -> (unit -> elt) -> unit -> t