hashtable size and significant bits of key
问题 I have a question regarding hashtable size and modular hashing. The hashing algorithm I'm referring to is the following: hash_key % table_size = array_index. I'm reading an algorithms textbook where the following bit of advice is given: If the table size is not prime, it may be the case that all of the bits of the key do not play a role in determining the array_index. Can anyone explain what this means exactly with an example? 回答1: What you want to avoid is common factors. There is a theorem