struct MinMaxHeap(T)

Included Modules

Defined in:

heap/min_max.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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.


[View source]
def self.new(initial_capacity : Int32 | Nil = nil, max_size : Int32 | Nil = nil, &block : T, T -> Int32) #

[View source]
def self.new(enumerable : Enumerable(T), max_size : Int32 | Nil = nil, &block : T, T -> Int32) #

[View source]
def self.new(enumerable : Enumerable(T), max_size : Int32 | Nil = nil) #

[View source]

Instance Method Detail

def <<(elem) #

[View source]
def each(*args, **options) #

[View source]
def each(*args, **options, &) #

[View source]
def max_elem_index #

[View source]
def peek #

[View source]
def peek_first #

[View source]
def peek_last #

[View source]
def pop #

[View source]
def pop_first #

[View source]
def pop_last #

[View source]
def push(elem : T) #

[View source]
def size(*args, **options) #

[View source]
def size(*args, **options, &) #

[View source]
def to_json(*args, **options) #

[View source]
def to_json(*args, **options, &) #

[View source]
def to_s(*args, **options) #

[View source]
def to_s(*args, **options, &) #

[View source]