Problem 3. Fill in the blanks regarding the state of a chaining hash table with
ID: 3724850 • Letter: P
Question
Problem 3. Fill in the blanks regarding the state of a chaining hash table with hash function h(x) = (x + 3) mod 8 and an array of length 8 after the following operations HashTable H; H.insert(19, 19); H.insert(3, 3); H.insert(9, 9); H.insert(5, 5); H.insert(1, 1); H.insert(10, 10); H.insert(11, 11); H.insert(17, 17); H.erase (3); H.erase (4); H.erase (5); The size of the linked list at index 4 is number The size of the linked list at index 6 is number The size of the shortest linked list in H is number The size of the longest linked list in H is numberExplanation / Answer
x (x+3) mod 8 19 6 3 6 9 4 5 0 1 4 10 5 11 6 17 4 after 3, 4 and 5 are removed hash table is 0 -> 1 -> 2 -> 3 -> 4 -> 9, 1, 17 5 -> 10 6 -> 19, 11 size of linked list at index 4 is 3 size of linked list at index 6 is 2 size of the shortest linked list in H is 0 size of the longest linked list in H is 3
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.