figure hash table with empty slots item hash value table simple hash function using remainders the mapping between an item and the slot where that item belongs in the hash table is called the hash function the hash function will take any item in the collection and return an integer in the range of slot namesbetween and assume that we have the set of integer items and our first hash functionsometimes referred to as the "remainder method,simply takes an item and divides it by the table sizereturning the remainder as its hash value ( (itemitem% table gives all of the hash values for our example items note that this remainder method (modulo arithmeticwill typically be present in some form in all hash functionssince the result must be in the range of slot names once the hash values have been computedwe can insert each item into the hash table at the designated position as shown in figure note that of the slots are now occupied this for this is referred to as the load factorand is commonly denoted by number_of_items table_size example now when we want to search for an itemwe simply use the hash function to compute the slot name for the item and then check the hash table to see if it is present this searching operation is ( )since constant amount of time is required to compute the hash value and then index the hash table at that location if everything is where it should bewe have found constant time search algorithm you can probably already see that this technique is going to work only if each item maps to unique location in the hash table for exampleif the item had been the next item in our collectionit would have hash value of ( % = since also had hash value of figure hash table with six items sorting and searching