{"id":19495818,"url":"https://github.com/aegoroff/godatastruct","last_synced_at":"2026-03-16T05:03:49.876Z","repository":{"id":57532350,"uuid":"151746147","full_name":"aegoroff/godatastruct","owner":"aegoroff","description":"Implementations of various fundamental data structures as tree, stacks, queues etc. in Go","archived":false,"fork":false,"pushed_at":"2024-06-07T20:46:14.000Z","size":251,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T03:41:18.538Z","etag":null,"topics":["algorithms","datastructure","datastructures","go","golang","library"],"latest_commit_sha":null,"homepage":"","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/aegoroff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-10-05T16:04:30.000Z","updated_at":"2024-06-07T20:46:18.000Z","dependencies_parsed_at":"2024-06-07T21:47:22.199Z","dependency_job_id":"3259d06a-198f-4000-b596-3519f16ba4a6","html_url":"https://github.com/aegoroff/godatastruct","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aegoroff%2Fgodatastruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aegoroff%2Fgodatastruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aegoroff%2Fgodatastruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aegoroff%2Fgodatastruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aegoroff","download_url":"https://codeload.github.com/aegoroff/godatastruct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250900413,"owners_count":21505049,"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":["algorithms","datastructure","datastructures","go","golang","library"],"created_at":"2024-11-10T21:39:06.892Z","updated_at":"2026-03-16T05:03:44.825Z","avatar_url":"https://github.com/aegoroff.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"godatastruct\n============\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9330121798cd4d11a796163ef52ecb0b)](https://app.codacy.com/gh/aegoroff/godatastruct/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![CI](https://github.com/aegoroff/godatastruct/actions/workflows/ci.yml/badge.svg)](https://github.com/aegoroff/godatastruct/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/aegoroff/godatastruct/branch/master/graph/badge.svg?token=zJDEi5IIc3)](https://codecov.io/gh/aegoroff/godatastruct)\n[![](https://tokei.rs/b1/github/aegoroff/godatastruct?category=code)](https://github.com/XAMPPRocky/tokei)\n\nImplementations of various fundamental data structures as tree, stacks, queues etc. in Go\n\n## Packages\n\n| Package | Description |\n|:--|:--|\n| rbtree | Red-black binary tree implementation that supports ordered statistic |\n| rbtree/special | Contains specialized Red-black search binary tree implementations |\n| countingsort | Counting sort is an algorithm for sorting a collection of objects according to keys that are small integers; that is, it is an integer sorting algorithm. |\n| collections | Various containers. Now only generic hashset implemented |\n\n## Benchmarks\n\nHere are some benchmark that compares RbTree, Google BTree and HashSet in various OS's:\n\n```commandline\ngoos: linux\ngoarch: amd64\npkg: github.com/aegoroff/godatastruct/rbtree\ncpu: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz\nBenchmark_RbTree_Insert-2            \t     146\t   8065465 ns/op\t 1437960 B/op\t   39744 allocs/op\nBenchmark_RbTree_ReplaceOrInsert-2   \t      94\t  12322666 ns/op\t 1437958 B/op\t   39744 allocs/op\nBenchmark_BTree_ReplaceOrInsert-2    \t     138\t   8593302 ns/op\t  946512 B/op\t   19955 allocs/op\nBenchmark_RbTree_Search-2            \t    8384\t    155340 ns/op\t    2931 B/op\t      47 allocs/op\nBenchmark_BTree_Search-2             \t    7102\t    160549 ns/op\t    3012 B/op\t      42 allocs/op\nBenchmark_StringHashSet_Search-2     \t  194384\t      5856 ns/op\t     122 B/op\t       1 allocs/op\nBenchmark_RbTree_Ascend-2            \t18868369\t        59.53 ns/op\t      16 B/op\t       1 allocs/op\nBenchmark_BTree_Ascend-2             \t     990\t   1035405 ns/op\t    5676 B/op\t     101 allocs/op\nBenchmark_RbTree_Descend-2           \t17982375\t        62.05 ns/op\t      16 B/op\t       1 allocs/op\nBenchmark_BTree_Descend-2            \t    1006\t   1035565 ns/op\t    5582 B/op\t      99 allocs/op\n```\n```commandline\ngoos: darwin\ngoarch: amd64\npkg: github.com/aegoroff/godatastruct/rbtree\ncpu: Intel(R) Xeon(R) CPU E5-1650 v2 @ 3.50GHz\nBenchmark_RbTree_Insert-3            \t     205\t   5889469 ns/op\t 1437958 B/op\t   39744 allocs/op\nBenchmark_RbTree_ReplaceOrInsert-3   \t     127\t   9342955 ns/op\t 1437961 B/op\t   39744 allocs/op\nBenchmark_BTree_ReplaceOrInsert-3    \t     132\t   8444145 ns/op\t  949028 B/op\t   19956 allocs/op\nBenchmark_RbTree_Search-3            \t    8524\t    130391 ns/op\t    2883 B/op\t      46 allocs/op\nBenchmark_BTree_Search-3             \t    8367\t    134109 ns/op\t    2566 B/op\t      35 allocs/op\nBenchmark_StringHashSet_Search-3     \t  208464\t      4917 ns/op\t     113 B/op\t       1 allocs/op\nBenchmark_RbTree_Ascend-3            \t21137170\t        56.48 ns/op\t      16 B/op\t       1 allocs/op\nBenchmark_BTree_Ascend-3             \t    1352\t    773357 ns/op\t    4129 B/op\t      74 allocs/op\nBenchmark_RbTree_Descend-3           \t20798305\t        51.98 ns/op\t      16 B/op\t       1 allocs/op\nBenchmark_BTree_Descend-3            \t    1664\t    676728 ns/op\t    3365 B/op\t      60 allocs/op\n```\n```commandline\ngoos: windows\ngoarch: amd64\npkg: github.com/aegoroff/godatastruct/rbtree\ncpu: Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz\nBenchmark_RbTree_Insert-2            \t     146\t   7957292 ns/op\t 1437957 B/op\t   39744 allocs/op\nBenchmark_RbTree_ReplaceOrInsert-2   \t      99\t  12133983 ns/op\t 1437957 B/op\t   39744 allocs/op\nBenchmark_BTree_ReplaceOrInsert-2    \t     136\t   8682621 ns/op\t  946224 B/op\t   19955 allocs/op\nBenchmark_RbTree_Search-2            \t    5938\t    204376 ns/op\t    4140 B/op\t      67 allocs/op\nBenchmark_BTree_Search-2             \t    5336\t    197659 ns/op\t    3997 B/op\t      56 allocs/op\nBenchmark_StringHashSet_Search-2     \t  186262\t      6147 ns/op\t     127 B/op\t       1 allocs/op\nBenchmark_RbTree_Ascend-2            \t15858182\t        68.24 ns/op\t      16 B/op\t       1 allocs/op\nBenchmark_BTree_Ascend-2             \t    1263\t    955326 ns/op\t    4420 B/op\t      79 allocs/op\nBenchmark_RbTree_Descend-2           \t15209337\t        70.29 ns/op\t      16 B/op\t       1 allocs/op\nBenchmark_BTree_Descend-2            \t    1226\t    967683 ns/op\t    4553 B/op\t      82 allocs/op\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faegoroff%2Fgodatastruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faegoroff%2Fgodatastruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faegoroff%2Fgodatastruct/lists"}