{"id":37979212,"url":"https://github.com/shawnsmithdev/wbtree","last_synced_at":"2026-01-16T18:33:01.385Z","repository":{"id":57691113,"uuid":"480607045","full_name":"shawnsmithdev/wbtree","owner":"shawnsmithdev","description":"wbtree is a weight balanced binary search tree for go 1.18+","archived":false,"fork":false,"pushed_at":"2022-04-26T22:43:32.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T17:46:38.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shawnsmithdev.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}},"created_at":"2022-04-12T01:12:15.000Z","updated_at":"2022-04-26T22:38:19.000Z","dependencies_parsed_at":"2022-08-27T19:40:55.269Z","dependency_job_id":null,"html_url":"https://github.com/shawnsmithdev/wbtree","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/shawnsmithdev/wbtree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fwbtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fwbtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fwbtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fwbtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shawnsmithdev","download_url":"https://codeload.github.com/shawnsmithdev/wbtree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnsmithdev%2Fwbtree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-16T18:33:01.300Z","updated_at":"2026-01-16T18:33:01.366Z","avatar_url":"https://github.com/shawnsmithdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/shawnsmithdev/wbtree.svg)](https://pkg.go.dev/github.com/shawnsmithdev/wbtree) [![Go Report Card](https://goreportcard.com/badge/github.com/shawnsmithdev/wbtree)](https://goreportcard.com/report/github.com/shawnsmithdev/wbtree) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# wbtree\nwbtree is a weight balanced binary search tree for go 1.18+\n\nFor more on weight balanced trees, see: https://yoichihirai.com/bst.pdf\n\nConcurrent access\n=================\nNo. This library does not support concurrent access (it is not \"thread-safe\").\nThis may be addressed in a future release. It may not. It is probably at least feasible to make it lock-free...\n\nBalance parameters\n==================\nThe choice of `\u003c3,2\u003e` as balance parameters here is mostly for the convienience of using simple integer values.\nThere's a somewhat faster setting, `\u003c1+sqrt(2), sqrt(2)\u003e`, which is not even rational.\nThe performance is quite close even with the integer params, so they are used, but it should be noted\nthat I've not benchmarked or even attempted any others yet.\n\nBasic usage\n===========\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/shawnsmithdev/wbtree\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tvar example *wbtree.Tree[*big.Int, string]\n\tvar inserted, removed bool\n\n\t// insert and update\n\texample, inserted = example.Insert(big.NewInt(5), \"fie\")\n\tfmt.Println(inserted) // true\n\texample, inserted = example.Insert(big.NewInt(5), \"five\")\n\tfmt.Println(inserted) // false\n\texample, _ = example.Insert(big.NewInt(4), \"four\")\n\texample, _ = example.Insert(big.NewInt(3), \"three\")\n\n\t// remove\n\tfmt.Println(example.Keys()) // 3, 4, 5\n\tfmt.Println(example.Values()) // []string{\"three\", \"four\", \"five\"}\n\texample, removed = example.Remove(big.NewInt(4))\n\tfmt.Println(removed) // true\n\texample, removed = example.Remove(big.NewInt(42))\n\tfmt.Println(false) // true\n\tfmt.Println(example.Values()) // []string{\"three\", \"five\"}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnsmithdev%2Fwbtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshawnsmithdev%2Fwbtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnsmithdev%2Fwbtree/lists"}