// hashtable.cpp: implementation of the hashtable class. // ////////////////////////////////////////////////////////////////////// #include "hashtable.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// hashtable::hashtable(int size) { hashTableSize = size; A = new value[size]; for (int i=0;i hashTableSize) { *hashValue = -1; //table is full return 0; }; }; return 0; //if we hit empty bucket then s is not in table. } int hashtable::getnum(String s) // returns the number of times s has been "found" { int hashValue; if (find(s,&hashValue)) return A[hashValue].num; return 0; }