Skip to content

2.0.0

Compare
Choose a tag to compare
@mhib mhib released this 28 Dec 18:39
· 44 commits to master since this release

Breaking changes

  • Second argument of #push now defaults to the first argument
# it is now possible to write
array.each { |el| heap.push(el) }
# instead of
array.each { |el| heap.push(el, el) }
  • PairingHeap#pop_priority was separated to two methods; PairingHeap#pop_priority and PairingHeap#pop_with_priority, similarly to SimplePairingHeap

New methods

  • #each returns an iterator of heap elements.
  • PairingHeap#get_priority_if_exists returns a pair where first element is success flag, and second element is priority.