Asking hash table problem 1. Consider the following hashtable: It was created wi
ID: 3580920 • Letter: A
Question
Asking hash table problem
1. Consider the following hashtable:
It was created with the hash function H(x) = x % 9 and uses a quadratic collision scheme.
Which of the following was the order in which the elements were inserted to produce the table above?
a. All of the insert orders listed here will produce the hashtable shown above.
b. None of the insert orders listed here will produce the hashtable shown above.
c. The insert order: 10, 81, 14, 63, 42 will produce the hashtable shown above.
d. The insert order: 81, 10, 42, 14, 63 will produce the hashtable shown above.
e. The insert order: 14, 42, 10, 81, 63 will produce the hashtable shown above
2. Consider the following hashtable:
It was created with the hash function H(x) = x % 9 and uses a linear collision scheme.
Suppose the element value 38 is inserted next into this table. What index will it get stored in?
a. It will get stored in index 5
b. It will get stored in index 2
c. It will get stored in index 0
d. It will get stored in index 1
e. It will get stored in index 8
Index 0 1 2 3 4 5 6 7 8 element 81 10 63 14 42Explanation / Answer
The answer 1 is
The insert order: 81, 10, 42, 14, 63 will produce the hashtable shown above.
as 81%9=0
10%9=1
42%9=6
14%9=5
63%9=0 but we have a element at 0 se we do 63%10=3 and insert it at 3rd index
answer 2
It will get stored in index 5
as 38%9=2 but it is full and so is 3 and 4 so it goies to next blank that is 5
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.