Interface for module Heap
open Basic
module type HEAP =
sig
type elem
type heap = Leaf | Node of heap × elem × heap
val empty: heap
val is_empty: heap ® bool
val insert: heap ® elem ® heap
val delete_max: heap ® (elem × heap)
val get_max: heap ® elem
val heap_of_list: elem list ® heap
end
module type MHEAP = (* Heap with merging *)
sig
type elem
type heap
val empty: heap
val is_empty: heap ® bool
val merge: heap ® heap ® heap
val insert: heap ® elem ® heap
val delete_max: heap ® (elem × heap)
val get_max: heap ® elem
val heap_of_list: elem list ® heap
end
module HeapFun (E:ORDERED) : HEAP with type elem = E.t
module MHeapFun (E:ORDERED) : MHEAP with type elem = E.t
January 31, 2002