hashing default implementations of this template are provided for standard types such as int and stringthusthe hash function described in figure could be implemented as template class hash publicsize_t operator()const string key size_t hashval forchar ch key hashval hashval chreturn hashval}the type size_t is an unsigned integral type that represents the size of an objectthereforeit is guaranteed to be able to store an array index class that implements hash table algorithm can then use calls to the generic hash function object to generate an integral type size_t and then scale the result into suitable array index in our hash tablesthis is manifested in private member function myhashshown in figure figure illustrates an employee class that can be stored in the generic hash tableusing the name member as the key the employee class implements the hashedobj requirements by providing equality operators and hash function object the code to implement makeemptycontainsand remove is shown in figure next comes the insertion routine if the item to be inserted is already presentthen we do nothingotherwisewe place it in the list (see fig the element can be placed anywhere in the listusing push_back is most convenient in our case whichlist is reference variablesee section for discussion of this use of reference variables any scheme could be used besides linked lists to resolve the collisionsa binary search tree or even another hash table would workbut we expect that if the table is large and the hash function is goodall the lists should be shortso basic separate chaining makes no attempt to try anything complicated we define the load factorlof hash table to be the ratio of the number of elements in the hash table to the table size in the example abovel the average length of list is the effort required to perform search is the constant time required to evaluate the hash function plus the time to traverse the list in an unsuccessful searchthe number size_t myhashconst hashedobj const static hash hfreturn hfx thelists size)figure myhash member function for hash tables