The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Maybe Pizza?
» Micro feed
Leo Robinovitch: A simple hash table in C:
"I implemented a simple hash table in C when solving a problem in CS Primer. Solving it helped me gain better intuition around hash functions, pointers, and memory segments like the stack and the heap."
I'm a mostly self taught programmer, and as such, I've never bothered to learn how hash tables work. But this implementation of a very simple hash table in C was pretty eye opening. Such as … well I now understand why it's called a hash table and how collisions are handled.
Such a simple and elegant solution for a data structure everyone uses all the time.