Class: Heap::Max
Overview
Keeps an heap sorted with the largest element on top
Instance Method Summary collapse
- #cmp(a, b) ⇒ Object
-
#initialize(array = []) ⇒ Max
constructor
A new instance of Max.
Methods inherited from Heap
inherited, #pop, #push, #push_all, #size, #sort, #sort_internal, #to_s, #top
Constructor Details
#initialize(array = []) ⇒ Max
Returns a new instance of Max.
59 |
# File 'lib/carat/heap.rb', line 59 def initialize(array=[]) super(array) end |
Instance Method Details
#cmp(a, b) ⇒ Object
61 |
# File 'lib/carat/heap.rb', line 61 def cmp(a,b) a > b end |