Code:

template <class TYPE>
class Hash{
public:
Hash(int max, int cap);
Hash();
virtual ~Hash();
virtual bool remove(const char* key)=0;
virtual bool find(const char* key, TYPE& holder)=0;
virtual bool update(const TYPE& data)=0;
int cap() const;
int max() const;
int size() const;
double loadfactor() const;
private:
int h_max;
int h_cap;
protected:
int h_size;
};
template <class TYPE>
Hash<TYPE>::~Hash(){
}
template <class TYPE>
Hash<TYPE>::Hash(){
}
template <class TYPE>
Hash<TYPE>::Hash(int max, int cap){
h_max = max;
h_cap = cap;
h_size = 0;
}
template <class TYPE>
int Hash<TYPE>::cap() const{
return h_cap;
}
template <class TYPE>
int Hash<TYPE>::max() const{
return h_max;
}
template <class TYPE>
int Hash<TYPE>::size() const{
return h_size;
}
template <class TYPE>
double Hash<TYPE>::loadfactor() const{
return (double)((double)h_size/(double)h_cap);
}