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
  • about 9 years ago
  • September 14, 2015
License

MIT License

Links
Synced at

Sun, 17 Nov 2024 14:58:11 GMT

Languages