Class: Algorithmable::DataStructs::Heap::Max

Inherits:
Imp
  • Object
show all
Defined in:
lib/algorithmable/data_structs/heap/max.rb

Instance Method Summary collapse

Constructor Details

#initialize(collection = []) ⇒ Max

Returns a new instance of Max.


5
6
7
8
9
# File 'lib/algorithmable/data_structs/heap/max.rb', line 5

def initialize(collection = [])
  super(collection) do |this, other|
    (this <=> other) < 0
  end
end