A hash file uses the division function to calculate the bucket number from the given key value. The file was set with 11 buckets numbered 0 to 10, where each bucket can contain at most 3 records. Analyse what happens when records with the following keys are inserted into the hash file. Explain what went wrong and suggest a solution.
15 27 44 79 30 26 38
5 35 9 16 45 57 18

Check the attachment for the table correctly displayed.

As written, the hashing algorithm described above is limiting and simplistic. It is not surprising that it took only 14 records to fill up one of the buckets in the hash table. The primary limiting factor is that only 3 records can be contained in each bucket.

The division function for hash tables divides the data value by the number of buckets, and the *remainder* is used for the bucket number. In mathematical terms, this is called "modulo arithmetic," commonly used in programming languages with the word "mod" or the percent symbol (%). 25 mod 10 would equal 5, since 25/10 = 2 with a remainder of 5. For the hash algorithm described above, the bucket number from 0 to 10 would be determined by the remainder after the data element is divided by 11.

For example, the first data element is 15. 15 mod 11 = 4, since 15 / 11 = 1 with a remainder of 4.

With that in mind, here is the hash buckets chosen as the data is entered. It is assumed that the data is entered in the order specified above.
15 mod 11 = 4 thus 15 goes in bucket 4, which now contains 1 record (15).
27 mod 11 = 5 thus 27 goes in bucket 5, which now contains 1 record (27).
44 mod 11 = 0 thus 44 goes in ...

Solution Summary

The expert examines hash division function numbers.

Please review the problem and explain each step of the solution listed below, and give me an example of an application which this property would be undesirable in a hashfunction.
problem
----------
Consider a version of the division method in which h(k) = k mod m, where m = (2^p) -1 and k is a character string interpreted

Consider the hashfunction object type
Class hFint256
{
Public:
unsigned int operator() (int item) const
{
Return (item/16 % 256);
}
};
(a) What is the size of the hash table?
(b) What are hFint256() (16) and hFint256() (257)?
(c) In general, what is the action of the hashfunction?

12.16
Consider the given hashing function object for strings. What can you say about strings "aefghk" and "gaefkh"? Is this a good hashing function? Why?
class hFstr
{
public:
unsigned int operator () (const string& s) const
{
int i;
unsigned int hashval = 0;
for ( i = 0; i < s.length(); i++)

Bob believes that he has come up with a nifty hashfunction. He assigns a numeric value VChar to each letter in the alphabet equal to the letter's position in the alphabet, i.e., VA = 1, VB = 2, ..., VZ = 26. For a message, he calculates the hash value H = (VChar 1 x VChar 2 x VChar 3 ...x VChar N) mod(26). Bob uses this functio

Explain one advantage that
a. a sequential file has over an indexed file
b. a sequential file has over a hash file
c. an indexed file has over a sequential file
d. an indexed file has over a hash file
e. a hash file has over a sequential file
f. a hash file has over an indexed file

See attached file for full problem description. - Advanced Associative Structures
Please provide a complete program if it makes sense.
Exercise 12.13
Assume that a hashfunction has the following characteristics:
Keys 257 and 567 hash to 3.
Keys 987 and 313 hash to 6.
Keys 734, 189, and 575 hash to 5.
Keys 122, 391

I am trying to create a program to help me with my business.
Here is a list of the countries around the world: http://www.arrl.org/files/file/DXCC/dxcclist_2011e.txt
Parse this list as appropriate to retrieve just the country names. Remove any country names that involve more than a single word. Use the remaining list of si

Q1 A client/server system requires remote users to use a password to log onto the server. Describe a simple scheme that would thwart eavesdroppers from obtaining and/or spoofing the password.
A1. unknown
Q2 Bob is concerned about the possibility of having his 100k byte file modified without his knowledge, so he calculate

Design a hashed file of words that could be used as a spell checker. What would you use as a hashfunction? Would your choice of a hashfunction depend on the language from which the words are chosen? Why should such a file not be stored as a sequential file? (ALSO EXPLAIN IN DETAIL)