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