{"id":22981043,"url":"https://github.com/rubyworks/pqueue","last_synced_at":"2025-09-11T05:08:03.760Z","repository":{"id":56888623,"uuid":"301602","full_name":"rubyworks/pqueue","owner":"rubyworks","description":"Priority Queue in pure Ruby","archived":false,"fork":false,"pushed_at":"2015-03-03T02:51:50.000Z","size":298,"stargazers_count":69,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-13T17:57:23.559Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubyworks.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":"Contributing.md","funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-09-09T00:57:30.000Z","updated_at":"2025-02-09T18:49:48.000Z","dependencies_parsed_at":"2022-08-20T23:40:29.287Z","dependency_job_id":null,"html_url":"https://github.com/rubyworks/pqueue","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rubyworks/pqueue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fpqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fpqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fpqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fpqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubyworks","download_url":"https://codeload.github.com/rubyworks/pqueue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Fpqueue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274579662,"owners_count":25310986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-15T01:46:50.165Z","updated_at":"2025-09-11T05:08:03.712Z","avatar_url":"https://github.com/rubyworks.png","language":"Ruby","readme":"# PQueue\n\n[![Gem Version](https://badge.fury.io/rb/pqueue.png)](http://badge.fury.io/rb/pqueue)\n[![Build Status](https://secure.travis-ci.org/rubyworks/pqueue.png)](http://travis-ci.org/rubyworks/pqueue) \u0026nbsp; \u0026nbsp;\n[![Flattr Me](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/324911/Rubyworks-Ruby-Development-Fund)\n\n[Website](http://rubyworks.github.com/pqueue) \u0026middot;\n[YARD API](http://rubydoc.info/gems/pqueue) \u0026middot;\n[Report Issue](http://github.com/rubyworks/pqueue/issues) \u0026middot;\n[Source Code](http://github.com/rubyworks/pqueue)\n\n\n## About\n\nPQueue is a priority queue with array based heap.\nA priority queue is like a standard queue, except that each inserted\nelement is given a certain priority, based on the result of the\ncomparison block given at instantiation time. Also, retrieving an element\nfrom the queue will always return the one with the highest priority\n(see #pop and #top).\n\nThe default is to compare the elements in respect to their #\u003c=\u003e method.\nFor example, Numeric elements with higher values will have higher\npriorities.\n\nThis library is  a rewrite of the original PQueue.rb by K. Kodama and\nHeap.rb by Ronald Butler. The two libraries were later merged\nand generally improved by Olivier Renaud. Then the whole library \nrewritten by Trans using the original as a functional reference.\n\n\n## Usage\n\nUsage is simple enough. Think of it as an array that takes a block, where\nthe block decides which element of the array goes first.\n\n    require 'pqueue'\n\n    pq = PQueue.new([2,3,1]){ |a,b| a \u003e b }\n\n    pq.pop  #=\u003e 3\n\n\n## Install\n\nUsing RubyGems:\n\n    gem install pqueue\n  \n\n## Acknowledgements\n\nAlthough the library has been completely rewritten since, we still would\nlike to acknowledge the efforts of the original PQueue authors and\ncontributors.\n\n* Olivier Renaud (2007)\n* Rick Bradley (2003)\n* Ronald Butler (2002)\n* K Kodama (2001, original library)\n\n\n## License \u0026 Copyrights\n\nCopyright (c) 2011 Rubyworks\n\nPQueue is distributable in accordance with the *BSD-2-Clause* license.\n\nPQueue is based on the original PQueue library (c) 2001 by K. Kodama.\n\nSee the LICENSE.txt file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyworks%2Fpqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyworks%2Fpqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyworks%2Fpqueue/lists"}