August 6th, 2003, 02:25 PM
SOS!! Distress Call
I am in a desperate situation to a C/C++ code for my final project. I tried all humanly possible ways to come thru it but in vain. I will be extremely thankful to anyone who could take a look at it and post me some help.
Thanks very much,
Here is the problem ....
Use a hash table with chaining. That each each element in the hash table is a linked list of nodes, each node will hold information about a single string. The hash key is the string itself. We also must manage the linked list of nodes. To do so the string is hashed a second time to produce a "string id number". Each node in the list holds the string id number and the string. The list is kept in ascending order on the string id number.
In the above case, we hash the string S to get the linked list in the table, then we hash S a second time to get the string id. Because the linked list is sorted, we can quit searching the list as soon as we get a node containing an id number larger than that of S. S is the name of the character string..
1> Code the proposal to make sure you understand it