Skip to content

Releases: mhib/pairing_heap

3.1.0

11 Feb 15:06
Compare
Choose a tag to compare
  • Implement merge operation for SimplePairingHeap

3.0.1

09 Apr 13:46
Compare
Choose a tag to compare

Fixed issues

  • change_priority could sometimes return nil instead of self

3.0.0

05 Feb 11:38
Compare
Choose a tag to compare

Breaking changes

  • #pop returns nil on empty heap instead of raising an Error
  • #get_priority returns nil on empty heap instead of raising an Error

New methods

  • PairingHeap::PairingHeap#include?
  • #each_with_priority

2.0.0

28 Dec 18:39
Compare
Choose a tag to compare

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.

1.0.0

04 Sep 19:39
Compare
Choose a tag to compare

First stable release

  • Refactor merge_pairs to use pointer swapping instead of ruby array to represent stack

  • Define *_with_priority and redefine *_priority methods
    Previous *_priority methods are now *_with_priority, *_priority only returns priority

  • Fix potential issue in #delete method, when deleting root element

0.3.0

08 Feb 19:45
Compare
Choose a tag to compare

Minor performance improvements

0.2.0

05 Feb 17:45
Compare
Choose a tag to compare

Included variant without change_priority support

First release

19 Feb 22:34
Compare
Choose a tag to compare
v0.1.0

Initial commit