Skip to content

Instantly share code, notes, and snippets.

View mikkolukas's full-sized avatar

Mikko Lukas Räsänen mikkolukas

  • Aarhus, Denmark
View GitHub Profile

I've come up with an interesting design for a hash map that instead of bucket lists, recursivly embeds more hash maps, but with a new key for each level.

Each hash map is super simple with two slots and hashe keys are 1 bit. However, the initial value is hashed to a 32-bit integer where each bit in the number is the key for each level in the recursive hash map.

In C, my structure looks like:

struct hash_tree_node {
  void *key;
 void *value;