struct

MinMaxHeap(T)

Inherits Enumerable < Struct < Value < Object

Constructors

new(initial_capacity : Int32 | Nil = nil, max_size : Int32 | Nil = nil)

if max_size is setted, when the heap size bigger than given size, the last element will be poped out.

Source
new(initial_capacity : Int32 | Nil = nil, max_size : Int32 | Nil = nil, &block : T, T -> Int32)
Source
new(enumerable : Enumerable(T), max_size : Int32 | Nil = nil, &block : T, T -> Int32)
Source
new(enumerable : Enumerable(T), max_size : Int32 | Nil = nil)
Source

Instance methods

<<(elem)
Source
each(*args, **options)
Source
each(*args, **options, &)
Source
max_elem_index
Source
peek
Source
peek_first
Source
peek_last
Source
pop_first
Source
pop_last
Source
push(elem : T)
Source
size(*args, **options)
Source
size(*args, **options, &)
Source
to_json(*args, **options)
Source
to_json(*args, **options, &)
Source
to_s(*args, **options)
Source
to_s(*args, **options, &)
Source