Build the hash table that results when the keys D , A , T , A ,
Fantastic news! We've Found the answer you've been seeking!
Question:
Build the hash table that results when the keys D A T A S T R U C T U R E S are inserted in that order into an initially empty table of size using double hashing. Then, answer the questions from to based on your solution.
Use hik k mod for the first hash function for the kth letter of the English alphabet.
Use hakk mod for the second hash function.
Hint: You can use the following precalculated hash values for the related keys.
hk
c u o
What are the indexes of As in the hashtable in the order of insertion?
A
B
C
D
E i
What are the indexes of Ts in the hashtable in the order of insertion?
A
B
C
D
E
What are the indexes of Us in the hashtable in the order of insertion?
A
B
C
D
E
What are the indexes that have been tried for C until it is put into its final position?
A
B
C
D
E
What are the indexes that have been tried for the second R until it is put into its final position?
A
B
C
D
E
What are the indexes that have been tried for E until it is put into its final position?
A
B
C
D
E
What is the index of the second S in the hashtable?
A
B
C
D
E Second S cannot be inserted into the hashtable.
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Posted Date: