{"id":19783478,"url":"https://github.com/liwnn/skiplist","last_synced_at":"2026-06-08T13:32:07.346Z","repository":{"id":41069701,"uuid":"504812402","full_name":"liwnn/skiplist","owner":"liwnn","description":"A fast skip list implementation for Go","archived":false,"fork":false,"pushed_at":"2022-08-29T12:32:19.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T21:02:41.613Z","etag":null,"topics":["algorithm","data-structures","go","golang","skiplist"],"latest_commit_sha":null,"homepage":"","language":"Go","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/liwnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-06-18T10:30:26.000Z","updated_at":"2022-08-31T10:52:56.000Z","dependencies_parsed_at":"2022-09-08T10:01:30.222Z","dependency_job_id":null,"html_url":"https://github.com/liwnn/skiplist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liwnn/skiplist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwnn%2Fskiplist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwnn%2Fskiplist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwnn%2Fskiplist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwnn%2Fskiplist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liwnn","download_url":"https://codeload.github.com/liwnn/skiplist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liwnn%2Fskiplist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34065349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["algorithm","data-structures","go","golang","skiplist"],"created_at":"2024-11-12T06:08:26.164Z","updated_at":"2026-06-08T13:32:07.326Z","avatar_url":"https://github.com/liwnn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Skip list implementation for Go\n\nThis Go package provides an implementation of skip list: [Skip Lists: A Probabilistic Alternative to Balanced Trees](https://www.cl.cam.ac.uk/teaching/2005/Algorithms/skiplists.pdf).\n\n\n## Usage\nAll you have to do is to implement a comparison `function Less() bool` for your Item which will be store in the skip list, here are some examples.\n\nA case for `int` items.\n``` go\npackage main\n\nimport (\n    \"github.com/liwnn/skiplist\"\n)\n\nfunc main() {\n\tsl := skiplist.New()\n\n\t// Insert some values\n\tfor i := 0; i \u003c 10; i++ {\n\t\tsl.Insert(skiplist.Int(i))\n\t}\n\n\t// Get the value of the key\n\titem := sl.Search(skiplist.Int(5))\n\tif item != nil {\n\t\tfmt.Println(item)\n\t}\n\n\t// Delete the key\n\tif sl.Delete(skiplist.Int(4)) {\n\t\tfmt.Println(\"Deleted\", 4)\n\t}\n\n\t// Traverse the list\n\tfor it := sl.NewIterator(); it.Valid(); it.Next() {\n\t\tfmt.Println(it.Value().(skiplist.Int))\n\t}\n}\n```\n\nA case for `struct` items:\n``` go\npackage main\n\nimport (\n    \"github.com/liwnn/skiplist\"\n)\n\ntype KV struct {\n\tKey   int\n\tValue int\n}\n\nfunc (kv KV) Less(than skiplist.Item) bool {\n\treturn kv.Key \u003c than.(KV).Key\n}\n\nfunc main() {\n\tsl := skiplist.New()\n\n\t// Insert some values\n\tfor i := 0; i \u003c 10; i++ {\n\t\tsl.Insert(KV{Key: i, Value: 100 + i})\n\t}\n\n\t// Get the value of the key\n\titem := sl.Search(KV{Key: 1})\n\tif item != nil {\n\t\tfmt.Println(item.(KV))\n\t}\n\n\t// Delete the key\n\tif sl.Delete(KV{Key: 4}) {\n\t\tfmt.Println(\"Deleted\", 4)\n\t}\n\n\t// Traverse the list\n\tfor it := sl.NewIterator(); it.Valid(); it.Next() {\n\t\tfmt.Println(it.Value().(KV))\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliwnn%2Fskiplist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliwnn%2Fskiplist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliwnn%2Fskiplist/lists"}