Heap, priority queue, and heapsort implemented in Ruby
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.rspec
Gemfile
Gemfile.lock
Guardfile
LICENSE.md
README.md

README.md

Ruby Heaps

  • Created when preparing a blog post on heaps (https://medium.com/@j.masland/what-the-bleep-is-a-heap-2b1afc20c167).
  • Implements the heap and the closely related priority queue in Ruby.
  • Contains a "monkey-patch" to add heap_sort and heap_sort! methods to the Array class (analogous to sort and sort!)
  • Not super efficient (due to its implementation in Ruby rather then C) - created for demonstration purposes.
  • Includes Rspec tests for several test cases