Skip to content

Latest commit

 

History

History

leftist_heap

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Leftist Heap

Based on the Leftist Heap discussed in section 3.1 of the book Purely Functional Data Structures with the following signature (in Standard ML):

signature HEAP =
sig
  structure Elem : ORDERED

  type Heap

  val empty     : Heap
  val isEmpty   : Heap -> bool

  val insert    : Elem.T * Heap -> Heap
  val merge     : Heap * Heap -> Heap

  val findMin   : Heap -> Elem.T  (* raises EMPTY if heap is empty *)
  val deleteMin : Heap -> Heap    (* raises EMPTY if heap is empty *)