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 and removes it from the heap.
maxheap = MaxHeap.new([1, 2, 3, 4])
maxheap.max! #=> 4
maxheap.size #=> 3
479 480 481 |
# File 'lib/containers/heap.rb', line 479 def max! self.pop end |