Docsity

Quiz Solution for CPSC 212-301 - Hash Table with Quadratic Probing and Double Hashing, Quizzes of Algorithms and Programming

Toggle sidebar
bg1
CPSC 212301 Name: _____________________________
Quiz #5 July 22, 2003
Closed books. Closed Notes. Calculators OK. 20 points. 10 minutes. Weight of each question in
parentheses. Please use a pencil. If you need more space, use the back of the sheet.
Insert the following values: 5 18 31 44 9 12 15 11 7
into an initially empty hash table using the hash function: f(x) = (x + 3)%13
a) (10) Show the final contents of the array if the collision handling method is quadratic probing
b) (10) Show the final contents of the array if the collision handling method is double hashing. Use
f2(x) = 11 – (x % 11)
as the second hash function.

Partial preview of the text

Download Quiz Solution for CPSC 212-301 - Hash Table with Quadratic Probing and Double Hashing and more Quizzes Algorithms and Programming in PDF only on Docsity!

CPSC 212  301 Name: _____________________________

Quiz #5 July 22, 2003

Closed books. Closed Notes. Calculators OK. 20 points. 10 minutes. Weight of each question in parentheses. Please use a pencil. If you need more space, use the back of the sheet. Insert the following values: 5 18 31 44 9 12 15 11 7 into an initially empty hash table using the hash function: f(x) = (x + 3)% a) (10) Show the final contents of the array if the collision handling method is quadratic probing b) (10) Show the final contents of the array if the collision handling method is double hashing. Use f 2 (x) = 11 – (x % 11) as the second hash function.