Question
All algorithms are in pseudocode Hash tables 3.1 (5p) For the input 30, 53, 58, 35, 93, 54, 25, 43, 31, 45 and hash function
All algorithms are in pseudocode
Hash tables
3.1 (5p) For the input 30, 53, 58, 35, 93, 54, 25, 43, 31, 45 and hash function h(k) = k mod 19, construct the open hash table.
3.2 (5p) Find the largest number of key comparisons in a successful search in this table. Find the average number of key comparisons in a successful search in this table.
3.3 (5p) Find the probability of all n keys being hashed to the same cell of a hash table of size m if the hash function distributes keys evenly among all the cells of the table.
3.4 (5p) Explain how to use hashing to check whether all elements of a list are distinct. What is the time efficiency of this application? Compare its with that of the brute-force solution and to the pre-sorting solution (first sort array then traverse to find if all elements are distinct)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started