https://github.com/toffaletti/zig-array-map
ArrayMap data structure for Zig
https://github.com/toffaletti/zig-array-map
zig
Last synced: 4 months ago
JSON representation
ArrayMap data structure for Zig
- Host: GitHub
- URL: https://github.com/toffaletti/zig-array-map
- Owner: toffaletti
- License: mit
- Created: 2021-06-06T01:45:07.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-22T05:19:09.000Z (over 3 years ago)
- Last Synced: 2025-03-08T17:08:35.739Z (4 months ago)
- Topics: zig
- Language: Zig
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zig ArrayMap
ArrayMap is a data structure that maps keys to values using an array of entries, optionally kept sorted by key. The contiguous layout in memory is cache friendly and can make ArrayMap a good choice for small amounts of data or data that is already sorted, written infrequently, but read many times.
```
┌┬────────────┬┬────────────┬┬────────────┬~
││ Entry ││ Entry ││ Entry │~
│├────┬┬──────┤├────┬┬──────┤├────┬┬──────┤~
││Key ││Value ││Key ││Value ││Key ││Value │~
└┴────┴┴──────┴┴────┴┴──────┴┴────┴┴──────┴~
```