** ** ** figure storing collection of product codes by direct mapping there is product with code and it can be directly accessed at array element if the target key is not in the collectionas is the case for product code the corresponding element ( will contain null reference this results in constant time search since we can directly examine specific element of the array and not have to compare the target key against the other keys in the collection hashing we can use the direct access technique for small sets of keys that are composed of consecutive integer values but what if the key can be any integer valueeven with small collection of keyswe cannot create an array large enough to store all possible integer values that' where hashing comes into play hashing is the process of mapping search key to limited range of array indices with the goal of providing direct access to the keys the keys are stored in an array called hash table and hash function is associated with the table the function converts or maps the search keys to specific entries in the table for examplesuppose we have the following set of keys and hash tablet containing elements we can define simple hash function (*that maps the keys to entries in the hash tableh(keykey you will notice this is the same operation we used with the product codes in our earlier example dividing the integer key by the size of the table and taking the remainder ensures the value returned by the function will be within the valid range of indices for the given table to add keys to the hash tablewe apply the hash function to determine the entry in which the given key should be stored applying the hash function to key yields result of which indicates should be stored in element of the hash table likewiseif we apply the hash function to the next four keys in the listwe findh( = ( = ( = ( = all of which are unique index values figure illustrates the insertion of the first five keys into the hash table