last minute hashtable fixes
This commit is contained in:
parent
4882cd51fa
commit
262cbe637e
@ -210,7 +210,7 @@ void HashTable<T>::_reHash(int h(const T &key, int size)) {
|
||||
if (nHashAry[nIndex].getOccupied() != 1) {
|
||||
nHashAry[nIndex].setItem(aT);
|
||||
nHashAry[nIndex].setOccupied(1);
|
||||
nHashAry[nIndex].setNumCollisions(i);
|
||||
nHashAry[nIndex].setNumCollisions(j);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ void writeToFile(const HashTable<T> &hashTable, const string &filename, string v
|
||||
|
||||
if (!outputFile.good()) {
|
||||
cout << "Error opening the output file: \"" << filename << "\"" << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
outputFile.flush();
|
||||
@ -252,6 +252,7 @@ void writeToFile(const HashTable<T> &hashTable, const string &filename, string v
|
||||
}
|
||||
}
|
||||
|
||||
cout << "Data written to file \"" << filename << "\".\n";
|
||||
outputFile.close();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user