{"id":20315221,"url":"https://github.com/sysread/php-skewheap","last_synced_at":"2025-09-07T20:04:58.336Z","repository":{"id":57064041,"uuid":"277931119","full_name":"sysread/php-skewheap","owner":"sysread","description":"Fast and flexible priority queues that can be quickly and easily merged together","archived":false,"fork":false,"pushed_at":"2020-07-08T14:44:16.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T02:01:37.854Z","etag":null,"topics":["heap","php","priority-queue","queue","skew-heap"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysread.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-07T22:01:31.000Z","updated_at":"2020-07-08T14:44:18.000Z","dependencies_parsed_at":"2022-08-24T07:50:15.274Z","dependency_job_id":null,"html_url":"https://github.com/sysread/php-skewheap","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sysread/php-skewheap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fphp-skewheap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fphp-skewheap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fphp-skewheap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fphp-skewheap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysread","download_url":"https://codeload.github.com/sysread/php-skewheap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fphp-skewheap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274088625,"owners_count":25220260,"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-07T02:00:09.463Z","response_time":67,"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":["heap","php","priority-queue","queue","skew-heap"],"created_at":"2024-11-14T18:18:21.607Z","updated_at":"2025-09-07T20:04:58.270Z","avatar_url":"https://github.com/sysread.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![build](https://github.com/sysread/php-skewheap/workflows/build/badge.svg)\n\n# NAME\n\nSkewHeap - mergable priority queues\n\n# SYNOPSIS\n\n    use sysread\\SkewHeap\\SkewHeap;\n\n    $heap = new SkewHeap;\n\n    foreach ($tasks as $task) {\n        $heap-\u003eput($task);\n    }\n\n    while (!$heap-\u003eis_empty()) {\n        my $next_task = $heap-\u003etake();\n        do_stuff_to($next_task);\n    }\n\n# DESCRIPTION\n\nA skew heaps are light-weight priority queues notable for their ability to be\nquickly merged with other heaps.\n\n# INSTALLATION\n\n    composer require sysread/php-skewheap\n\n# USAGE\n\n## CONSTRUCTOR\n\nAccepts an optional argument specifying a function to be used when comparing\nentries in the heap that returns -1, 0, or 1 if the first entry has a higher,\nequal, or lower priority, respectively. If not specified or null, a simple\nnumeric comparison is used, giving higher priority to the lower value.\n\nAny number of source heaps from which the skew heap should be initially\npopulated may be passed as additional arguments to the constructor.\n\n    $heap = new SkewHeap;\n\n    $heap = new SkewHeap(function($a, $b) {\n        return $a - $b;\n    });\n\n    $heap = new SkewHeap(null, $heap1, $heap2, ...);\n\n## METHODS\n\n### size()\n\nReturns the number of items in the heap.\n\n### is_empty()\n\nReturns true if there is at least one item in the queue.\n\n### put(...$items)\n\nInserts any number of items into the queue. Returns the new queue size.\n\n### peek()\n\nReturns the top item in the queue without removing it. Returns null when the\nqueue is empty.\n\n### take()\n\nRemoves and returns the next item in the queue. Returns null if the queue is\nempty.\n\n### drain()\n\nRemoves and returns an array of all items in the queue.\n\n### explain()\n\nPrints out a visual explanation of the heap structure for debugging.\n\n## AUTHOR\n\nJeff Ober \u003csysread@fastmail.fm\u003e\n\n## LICENSE\n\nCopyright (c) 2020 Jeff Ober\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Fphp-skewheap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysread%2Fphp-skewheap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Fphp-skewheap/lists"}