My hash function is as follows:
unsigned int Game::xorHash(const string &s)
{
unsigned int h = 0;
for (unsigned int i = 0; i < s.length(); i++ )
h ^= s.c_str()[i];
return h;
}
I am trying to distribute roughly 160,000 strings into a table that contains around 3-10 strings per. I'm pretty lost.
The above implementation is very top heavy. My assignment requires that I have at least 500 buckets, but any number above that will suffice.
Does anyone have anyone suggestions/direction? It would be greatly appreciated.