Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the double hashing h(k, i) = (h 1 (k) + ih 2 (k)) mod m. Write efficient pseudocode for Insert(T, k). Let the array
- Consider the double hashing h(k, i) = (h1(k) + ih2(k)) mod m. Write efficient pseudocode for Insert(T, k).
- Let the array size m = 23 = 8.
- Compute the linear probe sequence h(k, i) = (h'(k) + i) mod m, i = 0, 1, m1. Presume h'(k) = 4.
- Compute the quadratic probe sequence h(k, i) = (h'(k) + i(i+1)/2) mod m. Presume h'(k) = 4.
- Compute the double-hashing probe sequence h(k, i) = (h1(k) + ih2(k)) mod m, for each of k1 and k2, presuming h1(k1) = h1(k2) = 4, h2(k1) = 5, h2(k2) = 7.
- Consider hash tables with chaining. Determine the maximum value of n to ensure = n/m 1.5 for each value of m = 100, 200, 400, 800, 1600.
- Compute the linear probe sequence h(k, i) = (h'(k) + i) mod m, i = 0, 1, m1. Presume h'(k) = 4.
- Compute the quadratic probe sequence h(k, i) = (h'(k) + i(i+1)/2) mod m. Presume h'(k) = 4.
- Compute the double-hashing probe sequence h(k, i) = (h1(k) + ih2(k)) mod m, for each of k1 and k2, presuming h1(k1) = h1(k2) = 4, h2(k1) = 5, h2(k2) = 7.
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