Berg v1.0.0 Berg

A Minimum Heap for Integers

The Tatra Range

Link to this section Summary

Types

An Element (just an Integer)

t()

A Minimum Heap

Functions

A heap alongside an element where that element would be the smallest if it were in the heap

A heap with the same elements as the list in question

A heap whose smallest element is the minimum of the element in question and the smallest element of the heap in question

A list in ascending order (w/ all the same elements as the heap)

The smallest element of the heap

The heap in question w/o the smallest element

A Heap w/ just one element

A zero heap

Predicate: is this the zero heap?

Link to this section Types

Link to this type element()
element() :: integer

An Element (just an Integer)

A Minimum Heap

Link to this section Functions

Link to this function extract(x)
extract(Berg.t) :: {Berg.t, element}

A heap alongside an element where that element would be the smallest if it were in the heap

Link to this function heapify(x)
heapify([integer]) :: Berg.t

A heap with the same elements as the list in question

Link to this function insert(x, y)
insert(Berg.t, element) :: Berg.t

A heap whose smallest element is the minimum of the element in question and the smallest element of the heap in question

Link to this function listify(x)
listify(Berg.t) :: [integer]

A list in ascending order (w/ all the same elements as the heap)

The smallest element of the heap

The heap in question w/o the smallest element

A Heap w/ just one element

A zero heap

Link to this function zero?(x)
zero?(Berg.t) :: boolean

Predicate: is this the zero heap?