Hi,
A Hashtable is the most efficient form of retrieval structure as long as
you have an efficient hash algorithm (seeded random number generator).
and the performance degradation with volume is negligible so long as the
system is using some form of extendable hashing.
Look up info on extensible hashing to see how it all works.
An example link is here:
http://feast.ucsd.edu/CSE232W99/Indexing/sld034.htm
although the 'good' hash algorithm he suggests is a poor one
The GetHashCode() in .Net uses a version of the Zobel/Ramakrishna algorithm
(the best performing algorithm I'm aware of) but has been adapted to
produce a guaranteed unique key (not necessary for a hash table but
sometimes required internally by .Net).
If you want to 'roll your own' for some obscure data structure then I've
attached an adaptation of the hash function below.
Cheers,
Jason
Public Function computeHashCode(ByVal StrToHash As String) As Integer
Dim c As Byte() =
System.Text.Encoding.UTF8().GetBytes(StrToHash.ToCharArray())
Dim h As Integer = 31 'seed chosen at random
Dim i As Integer
For i = 0 To c.Length - 1
' L=5, R=2 works well for ASCII input
h = (h Xor ((h * 32) + (h \ 4) + c(i))) And &HFFFF
Next
Return h
End Function