//  File: hash.h
//
//  Header file for hash tables

#ifndef _hash_h
#define _hash_h

#include "list6.h"

typedef int hash_t ;

class HashTable {

public:
   HashTable(int) ;                 // Make table with approx. given size

   ~HashTable() ;

   void Insert(const ListItem&) ;   // Add item to table
   ListItem *Find(hash_t) ;         // Find item with given ssn
   void Delete(hash_t) ;            // Delete item with given ssn

   void dump() ;                    // Dump out entire table
   void stats() ;                   // Print out collision statistics

protected:
   List **Table ;                   // Array of pointers to Lists
   int Tsize ;                      // Table size, should be prime
   int count ;                      // number of items in the table

   int hash(hash_t) ;               // hash function
} ;

#endif
