#ifndef __ListHash__h
#define __ListHash__h
#include "HashTable.h"
#include <list>
//
// List Based Hash Table
//
//
class ListHash : public HashTable {
protected:
int N; // Size of hash table
std::list<Key> *keys; // Array of lists of keys
std::list<Object> *data; // Array of lists of data
// Used for statistical tracking
int insertions, // Number of insertions
collisions, // Number of times insertion had collision
searches, // Number of searches
sSteps; // Number of steps walked during searches
public:
// Internal functions
virtual int H(Key key); // Hash function H(k)
ListHash(int size);
void Insert(int key, Object data);
Object Search(int key);
void PrintStats();
};
#endif // ifdef __ListHash__h