Hash table visualization

preview_player
Показать описание
Open addressing hash table with linear probing.
Input is acending sequence of numbers encoded as ASCII text.
Black dots are used buckets, red dots are buckets reallocated due to collisions.
FNV1A hashing algorithm:
unsigned int fnv1aHash(const char * key)
{
unsigned int hash = 2166136261;
for (const char *s = key; *s; s++)
hash = 16777619 * (hash ^ (*s));
return hash;
};
Рекомендации по теме