1. A hash table that hashes all values to the same slot is essentially equivalent to what other data structure? 2. Analyze the hash functions (Lose lose, RS Hash, DJB2, and SDBM). Elaborate on the...

1 answer below »
1. A hash table that hashes all values to the same slot is essentially equivalent to what other data structure?
2. Analyze the hash functions (Lose lose, RS Hash, DJB2, and SDBM). Elaborate on the benefits and drawbacks of each hash function

3. Analyze the two methods for resolving collisions in hash tables (Open Addressing and Chaining). Elaborate on the benefits and drawbacks of each method

4. What strategies and issues should you consider when you are resizing a hash table? What are the likely complications? How would you address them?


Answered 1 days AfterAug 06, 2022

Answer To: 1. A hash table that hashes all values to the same slot is essentially equivalent to what other data...

Aditi answered on Aug 07 2022
69 Votes
Exercise:
Question 1:
The data structure of a linked list is functionally equivalent to a hash table, which maps each value's hash to the same space in the table. When many value
s are hashed in the same slot, the situation calls for a resolution method known as separate chaining and open hashing. Both of these methods may be found in modern computers. The sequential arrangement of values has a relationship-forming effect on the values themselves and the relationships between them.
Question 2:
I) DJB2:
Dan Bernstein initially described this method (k=33) in comp.lang.c many years ago. It has never been fully explained why the number 33 performs better than many other constants, whether they are prime or not. Another variant of this technique, presently preferred by Bernstein, employs xor: hash(i) = hash(i - 1) * 33 str[i].

II)SDBM
An implementation of this technique may be found in the free and open-source database management system known as the sdbm. More evenly distributed keys and fewer splits were detected due to its success in bit scrambling. It also has a strong universal hashing function with decent distribution. Gawk uses a quicker version of this method, which is hash(i) = hash(i - 1) * 65599 + str[i]. [An even quicker, duff-device version is also available] We chose the magic constant 65599 out of thin air while testing with other constants and discovered that it is a prime. In the Berkeley database (see sleepycat), as well as other places, this is a common approach.
•Lose Lose
Advantages: (1) It possesses the virtue of being quite straightforward. This is an extreme example of understatement;
(2)
It has the potential to be far better while yet maintaining its "extreme simplicity."
(3) It is now discovered intermingled with other acceptable code, such as...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here