{"id":17910129,"url":"https://github.com/austingebauer/go-treap","last_synced_at":"2025-04-03T06:28:50.824Z","repository":{"id":57607297,"uuid":"228694774","full_name":"austingebauer/go-treap","owner":"austingebauer","description":"A Go library that provides a balanced binary search tree by using binary heap properties and randomization.","archived":false,"fork":false,"pushed_at":"2019-12-30T07:05:55.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T20:23:55.552Z","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/austingebauer.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":"2019-12-17T20:18:49.000Z","updated_at":"2020-11-22T06:08:05.000Z","dependencies_parsed_at":"2022-08-29T23:52:23.368Z","dependency_job_id":null,"html_url":"https://github.com/austingebauer/go-treap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fgo-treap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fgo-treap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fgo-treap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fgo-treap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austingebauer","download_url":"https://codeload.github.com/austingebauer/go-treap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246946987,"owners_count":20859198,"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","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-10-28T19:29:18.217Z","updated_at":"2025-04-03T06:28:50.799Z","avatar_url":"https://github.com/austingebauer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-treap [![GoReportCard](https://goreportcard.com/badge/github.com/austingebauer/go-treap)](https://goreportcard.com/report/github.com/austingebauer/go-treap) [![GoDoc](https://godoc.org/github.com/austingebauer/go-treap?status.svg)](https://godoc.org/github.com/austingebauer/go-treap)\n\nA Go library that provides a balanced binary search tree \nby using binary heap properties and randomization.\n\nThe height of the treap is proportional to the logarithm of the number \nof values inserted with high probability. This characteristic means that, \non average, each `Search()`, `Insert()`, or `Delete()` operation takes logarithmic \ntime to perform.  \n\n## Installation\n\nTo install `go-treap`, use `go get`.\n\n```bash\ngo get github.com/austingebauer/go-treap\n```\n\nThen import the library into your Go program.\n\n```go\nimport \"github.com/austingebauer/go-treap\"\n```\n\n## Usage\n\n### API\n\nThe `go-treap` API provides `Search()`, `Insert()`, and `Delete()` functions with \n`O(log n)` time complexity on average.  \n\nPlease refer to the [GoDoc](https://godoc.org/github.com/austingebauer/go-treap) for \nadditional API documentation of the library.\n\n**Example 1**: Basic usage\n```go\ntrp := NewTreap()\n\ntrp.Insert(\"c\")\ntrp.Insert(\"b\")\ntrp.Insert(\"a\")\n\ntrp.Search(\"a\") // true\ntrp.Search(\"d\") // false\n\ntrp.Delete(\"b\")\ntrp.Delete(\"c\")\ntrp.Delete(\"a\")\n```\n\n### Behavior\n\nI recommend reading [Julia Evan's Blog Post on Treaps](https://jvns.ca/blog/2017/09/09/data-structure--the-treap-/) \nfor a simple explanation of the treap data structure.\n\n## Contributing\n\nPull requests are welcome. \n\nFor major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests along with changes.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustingebauer%2Fgo-treap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustingebauer%2Fgo-treap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustingebauer%2Fgo-treap/lists"}