{"id":20103880,"url":"https://github.com/ancientlore/go-avltree","last_synced_at":"2025-05-06T08:31:23.533Z","repository":{"id":13900243,"uuid":"16598790","full_name":"ancientlore/go-avltree","owner":"ancientlore","description":"AVL tree with some useful extensions written in Go","archived":false,"fork":false,"pushed_at":"2023-08-17T00:32:53.000Z","size":77,"stargazers_count":31,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"v2","last_synced_at":"2025-04-09T10:33:51.132Z","etag":null,"topics":["avl-tree","golang","tree"],"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/ancientlore.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}},"created_at":"2014-02-07T00:03:50.000Z","updated_at":"2024-08-16T01:45:33.000Z","dependencies_parsed_at":"2024-06-18T18:37:43.242Z","dependency_job_id":null,"html_url":"https://github.com/ancientlore/go-avltree","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancientlore%2Fgo-avltree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancientlore%2Fgo-avltree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancientlore%2Fgo-avltree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ancientlore%2Fgo-avltree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ancientlore","download_url":"https://codeload.github.com/ancientlore/go-avltree/tar.gz/refs/heads/v2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252648598,"owners_count":21782411,"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":["avl-tree","golang","tree"],"created_at":"2024-11-13T17:39:02.108Z","updated_at":"2025-05-06T08:31:23.528Z","avatar_url":"https://github.com/ancientlore.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-avltree\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/ancientlore/go-avltree/v2.svg)](https://pkg.go.dev/github.com/ancientlore/go-avltree/v2)\n\nAn [AVL tree](http://en.wikipedia.org/wiki/AVL_tree) (Adel'son-Vel'skii \u0026 Landis) is a binary search tree in which the heights of the left and right subtrees of the root differ by at most one and in which the left and right subtrees are again AVL trees.\n\nWith each node of an AVL tree is associated a balance factor that is Left High, Equal, or Right High according, respectively, as the left subtree has height greater than, equal to, or less than that of the right subtree.\n\nThe AVL tree is, in practice, balanced quite well. It can (at the worst case) become skewed to the left or right, but never so much that it becomes inefficient. The balancing is done as items are added or deleted.\n\nThis version is enhanced to allow \"indexing\" of values in the tree; however, the indexes are not stable as the tree could be resorted as items are added or removed.\n\nIt is safe to iterate or search a tree from multiple threads provided that no threads are modifying the tree.\n\nThe tree works on generic types and there is also a specialization for maps. Additionally, the tree supports iteration and a channel iterator.\n\n\tt.Do(func(z int) bool {\n\t\tif z % 3333 == 0 {\n\t\t\tfmt.Printf(\"%d \", z)\n\t\t}\n\t\treturn true\n\t})\n\n\tfor v := range t.Iter() {\n        \tif v % 3333 == 0 {\n                \tfmt.Printf(\"%d \", v);\n        \t}\n\t}\n\nTo install, you can use:\n\n\tgo get github.com/ancientlore/go-avltree/v2@latest\n\nFor more information on generics see:\n\n* https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md\n* https://go2goplay.golang.org/\n* https://blog.golang.org/generics-next-step\n* https://go.googlesource.com/go/+/refs/heads/dev.go2go/README.go2go.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fancientlore%2Fgo-avltree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fancientlore%2Fgo-avltree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fancientlore%2Fgo-avltree/lists"}