https://github.com/bor0/hashtable
Hashtable implementation in C
https://github.com/bor0/hashtable
algorithm c hashtable linked-list
Last synced: 3 months ago
JSON representation
Hashtable implementation in C
- Host: GitHub
- URL: https://github.com/bor0/hashtable
- Owner: bor0
- License: gpl-3.0
- Created: 2017-02-23T17:17:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T08:14:16.000Z (almost 4 years ago)
- Last Synced: 2025-04-11T00:35:37.726Z (6 months ago)
- Topics: algorithm, c, hashtable, linked-list
- Language: C
- Size: 39.1 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Hashtable implementation
------------------------
Hello. I wrote this mainly as an exercise to run some benchmark tests. I'm comparing this native implementation of hashtable in C with JS objects and Python dicts.The implementation uses separate chaining with linked lists for collision resolution. Thus, we have a fixed array (malloc'd) which we have O(1) access to it, and each value is actually a linked list.
The dependency relation between ht and ll is asymmetric.
For benchmarks, check the `benchmarks` folder.
To build the tests, write `make tests`.
To build the examples, write `make examples`.
To just build the library, write `make lib`.
To build everything, write `make`.
To cleanup, run `make clean`.
For memory leaks test, run `leaks -atExit -- ./ht_test | grep LEAK:`.
Boro Sitnikovski
February 2017