Method: Containers::MaxHeap#max
- Defined in:
- lib/containers/heap.rb
#max ⇒ Object
call-seq:
max -> value
max -> nil
Returns the item with the largest key, but does not remove it from the heap.
maxheap = MaxHeap.new([1, 2, 3, 4])
maxheap.max #=> 4
466 467 468 |
# File 'lib/containers/heap.rb', line 466 def max self.next end |