我的線性探測功能有什麼問題?線性探測散列函數不工作?
bool HashTable_lp::insert(const string & x)
{
// Insert x as active
int currentPos = findPos(x);
if(isActive(currentPos))
return true;
array[ currentPos ] = HashEntry(x, ACTIVE);
if(++currentSize > array.size()/2)
rehash();
return false;
}
爲什麼你認爲你正在做的有問題? – Beginner
,因爲我的碰撞計數和我的二次探測完全一樣:( – user977154
所以把它放到問題中吧。 – Beginner