std/heap
import std/heap to use it. Source: src/std/heap.iyi at v0.18.0.
push and pop keep the smallest element at the root, so Heap(Int32) is a min-heap. Empty pop and peek panic with pop of an empty heap and peek of an empty heap. The order is the trait's <=>, the same three-way Enumerable#sorted reads.
Heap(T)class
pub class Heap(T)
def empty? : Bool
def initialize
def peek : T where T : Comparable
def pop : T where T : Comparable
def push(value : T) : Nil where T : Comparable
def size : Int32
end
A binary heap over
Comparable.