by version_five · 3y ago · 0 comments
https://news.ycombinator.com/item?id=26590234
How to implement a hash table in C (benhoyt.com) 302 points by benhoyt on March 26, 2021, 158 comments
In my article I use "open addressing" [2] instead of linked lists for collisions, as 1) it tends to be simpler, as you only have one data structure to manage (array, rather than array and linked list), and 2) it tends to be faster, as linked lists are slow on modern CPUs because they require jumping around in memory.
It well enough and is conceptually probably the easiest approach to grok with relatively few pitfalls.