I am getting a strange runtime error when trying to run my hash table program. I have it separated in 3 separate files. I believe I have narrowed down where the error is occurring. It is either happening in insert(const &string s) or in the implementation of vector<list<string>> ht. I would appreciate some input. This is the implementation of insert():
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
void HTable::insert(const string &s)
{
int h = hash(s);
cout<<h<<endl;
list<string> &tempList = ht[h];
if( find( tempList.begin( ), tempList.end( ), s ) == tempList.end( ) )
{
tempList.push_back( s );
currentSize++;
}
cout<<currentSize<<endl;
}
and this is the declaration and implementation of my vector: