lundi 30 janvier 2023

HashTable:Determining Table size and which hash function to use

1)If the input data entries are around 10 raised to power of 9, do we keep the size of the hash table the same as input size or reduce the size? how to decide the table size? 2) if we are using numbers in the range of 10 raised to power of 6 as the key, how do we hash these numbers to smaller values? I know we use the modulo operator but module with what?

Kindly explain how these two things work. Its getting quite confusing. Thanks!!

I tried to make the table size around 75% of the input data size, that you can call as X. Then I did key%(X) to get the hash code. But I am not sure if this is correct.

Aucun commentaire:

Enregistrer un commentaire