being in need of a dynamic means of storing data indexed on textual information, I turned to creating a simple (but hopefully effective

For those who've never heard of a hash table; LOOK HERE (Hey Sparkie, that's not your website is it?

Basically then, a hash table acts like an array; but rather than indexing each entry of the array with an integer, a hash table allows you to use a string value.
E.g. I might wish to store peoples telephone numbers in an array. In order to then look-up Bob Smiths phone number, a hash table would allow something along the lines of
Code: Select all
bobstel = TelArray("Bob Smith").
Of course there can be 'collisions', but a good library will have contingency plans for such cases where more than one item of data attempt to share the same 'index'. In the case of my library if, for example, 3 'keys' generate the same hash, then I shove the 3 accompanying values into a linked list etc.
Anyhow, allocating sufficient memory and a good hashing algorithm are the key.
**Continued below (I don't like long posts!)