{"id":20315217,"url":"https://github.com/sysread/skewer","last_synced_at":"2025-08-26T12:08:03.299Z","repository":{"id":144226284,"uuid":"142921553","full_name":"sysread/skewer","owner":"sysread","description":"A priority queue for Go implemented using a skew heap","archived":false,"fork":false,"pushed_at":"2020-11-19T15:42:01.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-23T12:28:22.267Z","etag":null,"topics":["binary","data","go","heap","min","minqueue","priority","queue","skew","structure"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/sysread.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-07-30T19:52:06.000Z","updated_at":"2020-11-19T15:42:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e4833d1-557e-407e-aaf2-32ee53725fcd","html_url":"https://github.com/sysread/skewer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sysread/skewer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fskewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fskewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fskewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fskewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysread","download_url":"https://codeload.github.com/sysread/skewer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2Fskewer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272219210,"owners_count":24894376,"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-08-26T02:00:07.904Z","response_time":60,"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":["binary","data","go","heap","min","minqueue","priority","queue","skew","structure"],"created_at":"2024-11-14T18:18:20.127Z","updated_at":"2025-08-26T12:08:03.291Z","avatar_url":"https://github.com/sysread.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# skewer\n\n[![GoDoc](https://img.shields.io/badge/pkg.go.dev-doc-blue)](http://pkg.go.dev/github.com/sysread/skewer)\n\nPackage skewer - a mergable priority queue\n\nSkew heaps implement a priority queue (min heap) using a binary heap which\nis continually rebalanced with each Put and Take operation.  Skew heaps have\nan ammortized performance slighter better than O(log n).\n\nThe key feature of a skew heap is that it may be quickly and trivially\nmerged with another skew heap.  All heap operations are defined in terms of\nthe merge operation.\n\nMutable operations on the skew heap are atomic.\n\nFor more details, see [https://en.wikipedia.org/wiki/Skew_heap](https://en.wikipedia.org/wiki/Skew_heap)\n\n## Examples\n\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/sysread/skewer\"\n)\n\n// Define a type that implements SkewItem. A SkewItem need only provide a\n// single method, 'Priority', which returns the relative priority for an item\n// in the queue. This value becomes the sorting mechanism for items in the\n// heap. A lower value indicates a higher priority.\ntype Item int\n\nfunc (item Item) Priority() int {\n\t// Negate the item's value so that a higher number will be given a higher\n\t// priority.\n\treturn 0 - int(item)\n}\n\nfunc main() {\n\theap := skewer.New()\n\n\tfmt.Println(heap.Top())\n\n\tfor i := 0; i \u003c 5; i++ {\n\t\theap.Put(Item(i))\n\t}\n\n\tfor i := 0; i \u003c 5; i++ {\n\t\tfmt.Println(heap.Take())\n\t}\n\n}\n\n```\n\n---\nReadme created from Go doc with [goreadme](https://github.com/posener/goreadme)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Fskewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysread%2Fskewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Fskewer/lists"}