struct MinMaxHeap(T)
- MinMaxHeap(T)
- Struct
- Value
- Object
Included Modules
- Enumerable(T)
Defined in:
heap/min_max.crConstructors
-
.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.
- .new(initial_capacity : Int32 | Nil = nil, max_size : Int32 | Nil = nil, &block : T, T -> Int32)
- .new(enumerable : Enumerable(T), max_size : Int32 | Nil = nil, &block : T, T -> Int32)
- .new(enumerable : Enumerable(T), max_size : Int32 | Nil = nil)
Instance Method Summary
- #<<(elem)
- #each(*args, **options)
- #each(*args, **options, &)
- #max_elem_index
- #peek
- #peek_first
- #peek_last
- #pop
- #pop_first
- #pop_last
- #push(elem : T)
- #size(*args, **options)
- #size(*args, **options, &)
- #to_json(*args, **options)
- #to_json(*args, **options, &)
- #to_s(*args, **options)
- #to_s(*args, **options, &)
Constructor Detail
if max_size is setted, when the heap size bigger than given size, the last element will be poped out.
def self.new(initial_capacity : Int32 | Nil = nil, max_size : Int32 | Nil = nil, &block : T, T -> Int32)
#
def self.new(enumerable : Enumerable(T), max_size : Int32 | Nil = nil, &block : T, T -> Int32)
#