Method: Containers::Heap#next_key

Defined in:
lib/containers/heap.rb

#next_keyObject

call-seq:

next_key -> key
next_key -> nil

Returns the key associated with the next item in heap order, but does not remove the value.

Complexity: O(1)

minheap = MinHeap.new
minheap.push(1, :a)
minheap.next_key #=> 1


132
133
134
# File 'lib/containers/heap.rb', line 132

def next_key
  @next && @next.key
end