Class: Heap::Max

Inherits:
Heap show all
Defined in:
lib/mega/heap.rb

Overview

Keeps an heap sorted with the largest element on top

Instance Method Summary collapse

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.



74
# File 'lib/mega/heap.rb', line 74

def initialize(array=[]) super(array) end

Instance Method Details

#cmp(a, b) ⇒ Object



76
# File 'lib/mega/heap.rb', line 76

def cmp(a,b) a > b end