M
Mikke
Hello,
I'm using double hashing functions in my hashtable.
I have two following hashfuctions.
public int hashFunction1(int key)
{
return key % arraysize;
}
public int hashFunction2(int key)
{
// Less than array size.
return 5 - key % 5 // returns StepSize
}
The question is that if I'm going to pass the key as String
containing URL (http://localhost/mypage.html) to e.g. WWW page,
how should I actually convert that string to int? I am not sure.
Function declaration would then be following:
public int hashFunction1(String key)
public int hashFunction2(String key)
Can anyone give advise?
Thanks!
I'm using double hashing functions in my hashtable.
I have two following hashfuctions.
public int hashFunction1(int key)
{
return key % arraysize;
}
public int hashFunction2(int key)
{
// Less than array size.
return 5 - key % 5 // returns StepSize
}
The question is that if I'm going to pass the key as String
containing URL (http://localhost/mypage.html) to e.g. WWW page,
how should I actually convert that string to int? I am not sure.
Function declaration would then be following:
public int hashFunction1(String key)
public int hashFunction2(String key)
Can anyone give advise?
Thanks!