Complete the insertion of values into a Hash table with a K (or N) of 29. While
ID: 3778548 • Letter: C
Question
Complete the insertion of values into a Hash table with a K (or N) of 29. While inserting values, track how many probes it takes for completion. You will be using the data below for two types of hashing, linear and quadratic. For the sake of consistency, a “probe” is each time a table element is checked to see if open or not. There could be a chance that towards the end, probes may be hard to determine since it may appear infinite. If that is the case, place “undetermined” as your answer.
15 42 72 19 50 18 62 84 68 10 14 32 88 92 91 2 60 61 99 19 5 8 29 26 24 93 86 42 78
Explanation / Answer
15 % 29 = 15. So, insert at position 15.
42 % 29 = 13. So, insert at position 13.
72 % 29 = 14. So, insert at position 14.
19 % 29 = 19. So, insert at position 19.
50 % 29 = 21. So, insert at position 21.
18 % 29 = 18. So, insert at position 18.
62 % 29 = 4. So, insert at position 4.
84 % 29 = 13. So, insert at position 13.
68 % 29 = 10. So, insert at position 10.
10 % 29 = 10. Needs a second probe. So, insert at position 11.
14 % 29 = 14. Needs a second probe. Needs a third probe. So, insert at position 16.
32 % 29 = 3. So, insert at position 3.
88 % 29 = 1. So, insert at position 1.
92 % 29 = 5. So, insert at position 5.
91 % 29 = 4. Needs a second probe. Needs a third probe. So, insert at position 6.
2 % 29 = 2. So, insert at position 2.
60 % 29 = 2. Needs a sixth probe. So, insert at position 7.
61 % 29 = 3. Needs a sixth probe. So, insert at position 8.
99 % 29 = 12. So, insert at position 12.
19 % 29 = 19. Needs a second probe. So, insert at position 20.
5 % 29 = 5. Needs a fifth probe. So, insert at position 9.
8 % 29 = 8. Needs a tenth probe. So, insert at position 17.
29 % 29 = 0. So, insert at position 0.
26 % 29 = 26. Needs a second probe. So, insert at position 27.
24 % 29 = 24. So, insert at position 24.
93 % 29 = 6. Needs a seventeenth probe. So, insert at position 22.
86 % 29 = 28. So, insert at position 28.
42 % 29 = 13. Needs a eleventh probe. So, insert at position 23.
78 % 29 = 20. Needs a sixth probe. So, insert at position 25.
Therefore, the number of probes is: 80.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 15