PriorityQueue

PriorityQueue

A Heap implementation in crystal.

Installation

Add it to Projectfile

deps do
  github "hangyas/PriorityQueue"
end

Usage

require "PriorityQueue"

q = PriorityQueue{5, 2, 9}

q.pop #9
q.pop #5
q.pop #2

#custom order
q = PriorityQueue(Int32).new {|a, b| a < b}
q << 5 << 2 << 9

q.pop #2
q.pop #5
q.pop #9
Repository

PriorityQueue

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 0
  • over 8 years ago
  • September 14, 2015
License

MIT License

Links
Synced at

Wed, 15 May 2024 17:54:58 GMT

Languages