Module Pqueue.MakeMax

Functor building an implementation of the max-priority queue structure given a totally ordered type for elements.

Parameters

module E: OrderedType

Signature

type t;
let create: unit => t;
let length: t => int;
let is_empty: t => bool;
let add: t => E.t => unit;
let add_iter: t => ((E.t => unit) => 'x => unit) => 'x => unit;
let max_elt: t => option(E.t);
let get_max_elt: t => E.t;
let pop_max: t => option(E.t);
let remove_max: t => unit;
let clear: t => unit;
let copy: t => t;
let of_array: array(E.t) => t;
let of_list: list(E.t) => t;
let of_iter: ((E.t => unit) => 'x => unit) => 'x => t;
let iter_unordered: (E.t => unit) => t => unit;
let fold_unordered: ('acc => E.t => 'acc) => 'acc => t => 'acc;