heap v1.0.0 Heap
A heap is a special tree data structure. Good for sorting and other magic.
See also: Heap (data structure) on Wikipedia.
Summary
Functions
Test if the heap is empty
Create an empty max heap
Test it the heap contains the element
Create an empty min heap
Create an empty heap
Pop the root element off the heap and discard it
Push a new element into the heap
Return the element at the root of the heap
Return the number of elements in the heap
Quickly sort an enumerable with a heap
Types
t :: %Heap{d: term, h: term, n: term}
Functions
Specs
max :: Heap.t
Create an empty max heap.
A max heap is a heap tree which always has the largest value at the root.
Specs
min :: Heap.t
Create an empty min heap.
A min heap is a heap tree which always has the smallest value at the root.