/hash_table

Hash table exercise [04/2021][Ubuntu18]

Primary LanguageC++

hash_table

Just coding a hash table to grasp the concept

See Challenge HotRace repository ft. my sad BST map

This one here is a fixed array of lists. Each key is hashed into an index, which we try to make as unique as possible. If bad luck (or bad hashing algorithm) makes it so that two keys end up with the same hash, we can always extend the corresponding list to accomodate for it! But this mustn't happen too often or we'll lose some speed handling the list.

  • Compile with -O3 for best results, uncomment the "sync_with_stdio(false)" in main if you're reckless!