Question

In: Computer Science

SHOW WORK Draw the hash table that results using the hash function: h(k)=kmod7 to hash the...

SHOW WORK

Draw the hash table that results using the hash function: h(k)=kmod7 to hash the keys 41, 16, 40, 47, 10, 55. Assuming collisions are handled by Double hashing.

SHOW WORK

Solutions

Expert Solution

Solution for above task

Hash position = Input Value % Table Size

  • Hash position = 41 % 7 = 6

Attempting to insert 41 at position 6.

Inserting 41 at position 6.

Hash position = Input Value % Table Size

  • Hash position = 16 % 7 = 2

Attempting to insert 16 at position 2.

Inserting 16 at position 2.

Hash position = Input Value % Table Size

  • Hash position = 40 % 7 = 5

Attempting to insert 40 at position 5.

Inserting 40 at position 5.

Hash position = Input Value % Table Size

  • Hash position = 47 % 7 = 5(Collision)

= 5-(47%5) = 3 Positions from 5

Attempting to insert 47 at position 5.

Attempting to insert 47 at position 2.

Attempting to insert 47 at position 6.

Attempting to insert 47 at position 3.

Inserting 47 at position 3.

Hash position = Input Value % Table Size

  • Hash position = 10 % 7 = 3(Collision)

= 5-(10%5) = 5 Positions from 3

Attempting to insert 10 at position 3.

Attempting to insert 10 at position 6.

Attempting to insert 10 at position 2.

Attempting to insert 10 at position 5.

Attempting to insert 10 at position 1.

Inserting 10 at position 1.

Hash position = Input Value % Table Size

  • Hash position = 15 % 7 = 1(Collision)

= 5-(15%5) = 5 Positions from 1

Attempting to insert 15 at position 1.

Attempting to insert 15 at position 5.

Attempting to insert 15 at position 2.

Attempting to insert 15 at position 6.

Attempting to insert 15 at position 3.

Attempting to insert 15 at position 0.

Inserting 15 at position 0.

The final Hash Table is

Thank You

Don't forgot to give rating.


Related Solutions

3. Assume a hash table with 7 locations and the hashing function h(i) = i%7. Show...
3. Assume a hash table with 7 locations and the hashing function h(i) = i%7. Show the hash table that results when the integers are inserted in the order given. (10 points each. Total 30) • 5, 11, 18, 23, 28, 13, 25, with collisions resolved using linear probing • 5, 11, 18, 23, 28, 13, 25, with collisions resolved using quadratic probing • 5, 11, 18, 23, 28, 13, 25, with collisions resolved using chaining.
In C++ Use vectors instead of linked lists Create a Hash table program using H(key) =...
In C++ Use vectors instead of linked lists Create a Hash table program using H(key) = key%tablesize with Chaining and Linear probing for a text file that has a list of 50 numbers Ask the user to enter the file name, what the table size is, and which of the two options they want to use between chaining and linear probing
Using different K salts in the uptake media results in different H+ flux from the barley...
Using different K salts in the uptake media results in different H+ flux from the barley roots. Why? The K salts in question are KCl and KSO4.
Determine the convergence or divergence if each integral by using a comparison function. Show work using...
Determine the convergence or divergence if each integral by using a comparison function. Show work using the steps below: A. Indicate the comparison function you are using. B. Indicate if your comparison function is larger or smaller than the original function. C. Indicate if your comparison integral converges or diverges. Explain why. D. State if the original integral converges or diverges. If it converges, you don’t need to give the value it converges to. 16. integral from 0 to 1((e^(-x))/(√x))...
Which memory locations are assigned by the hashing function h(k) = k mod 97 to the...
Which memory locations are assigned by the hashing function h(k) = k mod 97 to the records of insurance company customers with these Social Security numbers? (a) 034-56-7981 (b) 220-19-5744 (c) 183-21-1232
Answer & show work andswer and show work answer n show work Using a sample of...
Answer & show work andswer and show work answer n show work Using a sample of 20 people, the testing agency found that 14 of them had better protection than that provided by the competitor. Do you have enough evidence to say/claom that your suncreen lotion provides better protection than the competitiors in a majority of cases? Use alpha = 0.01 to answer. 1. What are the apporiate hypotheses for situation? 2. the appropriate rejection rule is? 3. the calculated...
(1) Let G be a group and H, K be subgroups of G. (a) Show that...
(1) Let G be a group and H, K be subgroups of G. (a) Show that if H is a normal subgroup, then HK = {xy|x ? H, y ? K} is a subgroup of G. (b) Show that if H and K are both normal subgroups, then HK is also a normal subgroup. (c) Give an example of subgroups H and K such that HK is not a subgroup of G.
Question 1: Show that x = h + r cos t and y = k +...
Question 1: Show that x = h + r cos t and y = k + r sin t represents the equation of a circle. Question 4: Find the area above the polar x-axis and enclosed by r = 2−cos(θ). Question 5: If r = f(θ) is a polar curve, find the slope of the tangent line at a point (r0,θ0).
Using these results, complete the table below and then use your results to answer the questions...
Using these results, complete the table below and then use your results to answer the questions that follow. (Please remember to round all answers to two decimal places: 0.00 at each step.) (23 points) X X-M (X-M)2 1 14 -15.85 251.22 2 16 -13.85 191.82 3 18 -11.85 140.42 4 20 -9.85 97.02 5 23 -6.85 46.92 6 23 -6.85 46.92 7 25 -4.85 23.52 8 27 -2.85 8.12 9 28 -1.85 3.42 10 29 -0.85 0.72 11 30 0.15...
Please show all work and all units Using the following Equilibrium equation.... CO2(g) + H​2(g) <--->...
Please show all work and all units Using the following Equilibrium equation.... CO2(g) + H​2(g) <---> CO (g) + H2O (g) InitIal pressures for all are 0.10 atm... Kc = 0.64 at room temperature A) Calculate Kp value for rxn ​B) Calculate Rxn Qp ​C) To reach equilibrium, what direction must rxn proceed to reach equilibrium? ​D) Construct ICE Table for this equilibrium ​E) Solve for X and calculate the equilibrium pressures of each species.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT