module MinMaxHeap:An imperative array based min-max heap data structure. Adding elements and removing the minimum and maximum element have logarithmic complexity.
See: Atkinson, Sack, Santoro, Strothotte Mix-Max Heaps and Generalized Priority Queues. Communications of the ACM 1986, October 26, Volume 29, Number 10, p.996-1000
The heap can take up to Sys.max_array_length elements.
| Parameters: |
|
typedata =Ord.t
type t
val create : data -> tval add : t -> data -> unitOVERFLOW if the heap is full.val min : t -> dataNot_found if the heap is empty.val max : t -> dataNot_found if the heap is empty.val remove_min : t -> dataNot_found if the heap is empty.val remove_max : t -> dataNot_found if the heap is empty.val iter : (data -> unit) -> t -> unitval is_empty : t -> boolval size : t -> intval to_string : t -> string