1. [Hash table] Assume we have a hash table of size 7, key-value pairs which are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. [Hash table] Assume we have a hash table of size 7, key-value pairs which are both integers, and the following hash function: h(x) = (3 * x + 5) mod 11 %3D a) The hash function above will generate hashes that are not usable by our hash table. Please ADD SOMETHING to the hash function (do NOT remove anything) so that it will work most properly. Write down the updated function in the answer book. (4%) b) Please write down the hashes for key = 2, 6, 8 and 13 with the updated function. (2%) c) Assuming linear probing, what will be inside the hash table after the key value pairs of <2,1>, <6,2>, <13,3> and finally <8,4> are inserted? Please draw the hash table to illustrate. (5%) d) Draw the results in c) if we use quadratic probing instead. (4%) 1. [Hash table] Assume we have a hash table of size 7, key-value pairs which are both integers, and the following hash function: h(x) = (3 * x + 5) mod 11 %3D a) The hash function above will generate hashes that are not usable by our hash table. Please ADD SOMETHING to the hash function (do NOT remove anything) so that it will work most properly. Write down the updated function in the answer book. (4%) b) Please write down the hashes for key = 2, 6, 8 and 13 with the updated function. (2%) c) Assuming linear probing, what will be inside the hash table after the key value pairs of <2,1>, <6,2>, <13,3> and finally <8,4> are inserted? Please draw the hash table to illustrate. (5%) d) Draw the results in c) if we use quadratic probing instead. (4%)
Expert Answer:
Answer rating: 100% (QA)
hx 3 x 5 mod 11 For x 1 h1 3 1 5 mod 11 8 mod 11 8 For x 2 h2 3 2 5 mod 11 11 mod 11 0 Fo... View the full answer
Related Book For
Posted Date:
Students also viewed these algorithms questions
-
Assume we have a demand-paged memory. The page table is held in registers. It takes 8 milliseconds to service a page fault if an empty page is available or the replaced page is not modified and 20...
-
Assume we have a refrigerator operating at steady state using 500 W of electric power with a COP of 2.5. What is the net effect on the kitchen air?
-
Assume we have a refrigerator operating at steady state using 500 W of electric power with a COP of 2.5. What is the net effect on the kitchen air?
-
The following appliances are connected to a single 120 V, 15 A circuit in a kitchen: a 330 W blender, a 1000 W coffeepot, a 150 W coffee grinder, and a 750 W microwave oven. If these are all turned...
-
Let L: V V be a linear operator, where V is an n-dimensional vector space. Let be an eigenvalue of L. Prove that the subset of V consisting of 0V and all eigenvectors of L associated with is a...
-
Solve each rational inequality. Give the solution set in interval notation. 1 x + 2 3
-
What happens if you specify an invalid format string?
-
You are auditing payroll for the Morehead Technologies Company for the year ended October 31, 2011. Included next are amounts from the client's trial balance, along with comparative audited...
-
Matt has worked as an electrician for 24 years with the same company and is about to retire. He has a final-earnings pension plan. His pension benefit will be 1% per year based on the average of his...
-
VF Corporation is an apparel company that owns recognizable brands like Timberland, Vans, Reef, and 7 For All Mankind. Exhibit 5.18 and 5.19 present balance sheets and income statements,...
-
Financial Statement of Accounting for CLUB and Society The following is the receipt and payment account for UPM Rugby Club for the year ended 31st December 2016. Receipts Subscriptions 18,550...
-
When an organization periodically assesses its security policies and procedures that relate to ePHI, what is it helping to maintain?
-
3. (10 points) Determine if this function is a quadratic spline? Explain why or why not. Q(x) = I 2 4 -
-
What is used by a third-party payer of a claim to inform a service provider with information on what has been paid and why?
-
___________ exposure refers to repeated exposure to chemicals Most affected organ attacked by a chemical is called _______________ organ. An __________ _reaction, or sensitization as it is also...
-
consider RSA algorithm with p-5 and q=11. a. What are n and (n)? b. Let e be 3. Is this an acceptable choice for e? If yes, why? If not, can you suggest a different number? c. Find d such that de-1...
-
Last year Bridget purchased a $1,000 face value corporate bond with an 8% annual coupon rate and a 30-year maturity. At the time of the purchase, it had an expected yield to maturity of 7.04%. If...
-
When the concentration of a strong acid is not substantially higher than 1.0 10-7 M, the ionization of water must be taken into account in the calculation of the solution's pH. (a) Derive an...
-
Each round in a block cipher should be invertible to make the whole block invertible. Modern block ciphers use two approaches to achieve this. In the first approach, each component is invertible; in...
-
If the switch in Figure 17.3 is connected to a router to provide access to the Internet, does it need a link-layer address? Explain. Figure 17.3 Figure 17.3 Link-layer switch Switch Switching table...
-
What is the maximum effect of a 2-ms burst of noise on data transmitted at the following rates? a. 1500 bps b. 12 kbps c. 100 kbps d. 100 Mbps
-
A Marist poll survey showed that 47% of respondents chose whatever as the most annoying phrase used in conversation. What is the probability of randomly selecting someone choosing something different...
-
According to the National Association for College Admissions Counseling and USA Today, 19.8% of college students take at least one class online. What is the probability of randomly selecting a...
-
Let R be the event of randomly selecting a senator and getting a Republican, and let D represent the event of randomly selecting a second different senator and getting a Democrat. Use words to...
Study smarter with the SolutionInn App