retagged by
498 views
0 votes
0 votes
Consider the last four digits of your register number and form the following numbers:

1. first digit

2. second digit

3. third digit

4. fourth digit

5. 2 digit number with the first two digits

6. 2 digit number with the last two digits

7. 3 digit number with the first three digits

8. 4 digit number with all the digits

Insert only the unique numbers among the above in the same order as mentioned above into a

hash table of size 10. The hash function is hence,

hash(n) = n % 10

Draw the contents of the hash table when collisions are resolved using

a. Linear Probing

b. Quadratic Probing

c. Double Hashing

Example:

If your register number is 21BPS1504, the numbers formed are:

1, 5, 0, 4, 15, 04 (i.e. 4), 150, 1504

Among these, the numbers inserted in order are: 1, 5, 0, 4, 15, 150, 1504

Here, the second 4 is not inserted since only unique numbers are to be inserted.

These numbers are to be inserted into a hash table whose description is given above and

the contents of the table after insertion are to be clearly given.
retagged by

1 Answer

0 votes
0 votes
Only the last digit is taken into consideration for each pattern. So,

1 clashes with none.

2 clashes with 5

3 classes with 7

4 classes with 6 and 8

No related questions found