choosing good hash functions in principleany convenient function can be used as primary hash function howeverwhat is important when choosing good hash function is to make sure that it spreads the space of possible keys onto the set of hash table indices as evenly as possibleor more collisions than necessary will occur secondlyit is advantageous if any potential clusters in the space of possible keys are broken up (something that the remainder in division will not do)because in that case we could end up with 'continuous runand associated clustering problems in the hash table thereforewhen defining hash functions of strings of charactersit is never good idea to make the last (or even the firstfew characters decisive when choosing secondary hash functionsin order to avoid primary clusteringone has to make sure that different keys with the same primary position give different results when the secondary hash function is applied secondlyone has to be careful to ensure that the secondary hash function cannot result in number which has common divisor with the size of the hash table for exampleif the hash table has size and we get secondary hash function which gives (or or as resultthen only half of the locations will be checkedwhich might result in failure (an endless loopfor examplewhile the table is still half empty even for large hash tablesthis can still be problem if the secondary hash keys can be similarly large simple remedy for this is to always make the size of the hash table prime number complexity of hash tables we have already seen that insertsearch and delete all have ( time complexity if the load factor of the hash table is kept reasonably lowe below but having higher load factors can considerably slow down the operations the crucial search time complexity of particular form of hash table is determined by counting the average number of location checks that are needed when searching for items in the table when it has particular load factorand that will depend on whether the item is found the following table shows the average number of locations that need to be checked to conduct successful and unsuccessful searches in hash tables with different collision handling strategiesdepending on the load factor given in the top row it shows how the different approaches and cases vary differently as the table becomes closer to fully loaded strategy successful search direct chaining linear probing double hashing unsuccessful search direct chaining linear probing double hashing it also shows the considerable advantage that double hashing has over linear probingparticularly when the load factors become large whether or not double hashing is preferable to