Any tips on how to implement a hashmap in C with (close to) zero collisions while not allocating much more space than necessary?

I’m new to this sort of stuff, so pardon my ignorance. Here is what I have so far: github.com/dannyvankooten/c-ha

It distributes pretty evenly, but in my example using ~45.000 dates keys about 19% share a spot with at least one other nose.

@brombek Perfect, just the pointer I needed. Will look into it; thank you! 🙏

Sign in to participate in the conversation
Mastodon 🔐 privacytools.io

Fast, secure and up-to-date instance. PrivacyTools provides knowledge and tools to protect your privacy against global mass surveillance.

Website: privacytools.io
Matrix Chat: chat.privacytools.io
Support us on OpenCollective, many contributions are tax deductible!