{"id":33926505,"url":"https://github.com/nlfiedler/hashed-array-tree","last_synced_at":"2025-12-12T10:19:41.725Z","repository":{"id":320669606,"uuid":"1082972845","full_name":"nlfiedler/hashed-array-tree","owner":"nlfiedler","description":"Hashed-Array Trees","archived":false,"fork":false,"pushed_at":"2025-10-25T04:58:46.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-25T06:28:13.899Z","etag":null,"topics":["data-structures"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/hashed-array-tree","language":"Rust","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/nlfiedler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-25T04:57:22.000Z","updated_at":"2025-10-25T05:01:23.000Z","dependencies_parsed_at":"2025-10-25T07:00:11.605Z","dependency_job_id":null,"html_url":"https://github.com/nlfiedler/hashed-array-tree","commit_stats":null,"previous_names":["nlfiedler/hashed-array-tree"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nlfiedler/hashed-array-tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlfiedler%2Fhashed-array-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlfiedler%2Fhashed-array-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlfiedler%2Fhashed-array-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlfiedler%2Fhashed-array-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nlfiedler","download_url":"https://codeload.github.com/nlfiedler/hashed-array-tree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlfiedler%2Fhashed-array-tree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27680726,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"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":["data-structures"],"created_at":"2025-12-12T10:19:41.124Z","updated_at":"2025-12-12T10:19:41.719Z","avatar_url":"https://github.com/nlfiedler.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hashed Array Trees\n\n## Overview\n\nThis Rust crate provides an implementation of hashed array trees as described by Edward Sitarski in the Algorithm Alley column of the September 1996 edition of Dr. Dobb's Journal.\n\nThis data structure supports `push` and `pop` operations and does _not_ support inserts or removes at other locations within the array. One exception is the `swap/remove` operation which will retrieve a value from a specified index, overwrite that slot with the value at the end of the array, decrement the count, and return the retrieved value.\n\n### Memory Usage\n\nCompared to the `Vec` type in the Rust standard library, this data structure will have substantially less unused space, on the order of O(√N). The dope vector contributes to the overhead of this data structure, and that is on the order of O(√N). Based on the current implementation of `Vec`, as much as 50% of the space may be unused since it has a growth factor of 2.\n\n## Examples\n\nA simple example copied from the unit tests.\n\n```rust\nlet mut sut = HashedArrayTree::\u003cusize\u003e::new();\nfor value in 0..13 {\n    sut.push(value);\n}\nassert_eq!(sut.len(), 13);\nassert_eq!(sut.capacity(), 16);\nfor value in 0..13 {\n    assert_eq!(sut[value], value);\n}\n```\n\n## Supported Rust Versions\n\nThe Rust edition is set to `2024` and hence version `1.85.0` is the minimum supported version.\n\n## Troubleshooting\n\n### Memory Leaks\n\nFinding memory leaks with [Address Sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html) is fairly [easy](https\\\n://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html) and seems to work best on Linux. A Docker contai\\\nner with bash access and [Rust](https://rust-lang.org) nightly installed can be found in the `containers` directory.\n\n```shell\ncd containers\ndocker compose build --pull\ndocker compose run leaktest\nsh leak.sh\n```\n\nIf no problems were detected, a single line of output will appear. When done, clean up the docker artifacts.\n\n```shell\nexit\ndocker compose down\n```\n\n## References\n\n* [HATs: Hashed Array Trees (1996)](https://jacobfilipp.com/DrDobbs/articles/DDJ/1996/9609/9609n/9609n.htm)\n    - An archived version of the original article from Dr. Dobb's Journal.\n\n## Other Implementations\n\n* [Aca-S/hashed-array-tree](https://github.com/Aca-S/hashed-array-tree) (C++)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlfiedler%2Fhashed-array-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlfiedler%2Fhashed-array-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlfiedler%2Fhashed-array-tree/lists"}