Show the resulting table using double hashing with h2(x) = 11 - (x mod 11)
the image is given. just "Show the resulting table using double hashing with h2(x) = 11 - (x mod 11)" need to be solve. Thanks
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
4290 | 3823 | 2850 | 1941 | 8806 | 7413 | 8479 | 8783 | 3593 | 8818 |
h(3823)=3823%13=1 at position 1
h(8806)=8806%13=5 at position 5
h(8783)=8783%13=8 at position 8
h(2850)=2850%13=3 at position 3
h(3593)=3593%13=5 collision use h2(3593) = 11 - (3593 mod 11)=11-7=4
(h(3593)+1*h2(3593))%13=(5+1*4)%13=9 at position 9
h(8479)=8479%13=3 at position 3 collision use h2(8479) = 11 - (8479 mod 11)=11-9=2
(h(8479)+1*h2(8479))%13=(5+1*2)%13=7 at position 7
h(1941)=1941%13=4 at position 4
h(4290)=4290%13=0 at position 0
h(8818)=8818%13=4 at position 4 collision use h2(8818) = 11 - (8818mod 11)=11-7=4
(h(8818)+1*h2(8818))%13=(4+1*4)%13=8 at position 8 collision
(h(8818)+2*h2(8818))%13=(4+2*4)%13=12 at position 12
h(7413)=7413%13=3 at position 3 collision use h2(7413) = 11 - (7413mod 11)=11-10=1
(h(7413)+1*h2(7413))%13=(3+1*1)%13=4 at position 4 collision
(h(7413)+2*h2(7413))%13=(3+2*1)%13=5 at position 5 collision
(h(7413)+3*h2(7413))%13=(3+3*1)%13=6 at position 6
Show the resulting table using double hashing with h2(x) = 11 - (x mod 11) the...
3. Given input (89, 18, 49, 58, 69), h)k(mod 10) g) Iymod 8), and a hash function f(k) h(k) +j-g(k) (mod 10), show the resulting hash table. Solve collisions with double hashing.
3. Given input (89, 18, 49, 58, 69), h)k(mod 10) g) Iymod 8), and a hash function f(k) h(k) +j-g(k) (mod 10), show the resulting hash table. Solve collisions with double hashing.
5. Hashing (a) Consider a hash table with separate chaining of size M = 5 and the hash function h(x) = x mod 5. i. (1) Pick 8 random numbers in the range of 10 to 99 and write the numbers in the picked sequence. Marks will only be given for proper random numbers (e.g., 11, 12, 13, 14 ... or 10, 20, 30, 40, .. are not acceptable random sequences). ii. (2) Draw a sketch of the hash table...
1. Using closed hashing with double hashing to resolve collisions insert the following keys into a table with 11 slots, numbered 0 through 10. The hash functions to be used are H1(k)k(mod11) and H2(k)- Rev(k + 1) (mod11) The function REV reverses the decimal digits like Rev(376) 673. Show the hash table after all nine keys have been inserted. Be sure to indicate how H1 and H2 are used. Keys: 4, 3, 2, 8, 33, 17, 24, 35, 46
Part 5. Suppose that your hash function resolves collisions using the open addressing method with double hashing. The double hashing method uses two hash functions h and h'. Assume that the table size N = 13, h(k) = k mod 13, h'(k) = 1 + (k mod 11), and the current content of the hash table is: 0 1 2 3 6 7 8 9 10 11 12 4 17 5 98 If you insert k = 14 to this...
10. Submission In this question you will work with a hash table that uses double hashing. The hash table is size 11, the primary hash function is h(K)-K mod 11, and the secondary hash function is hp(K)-(K mod9) +1 Take an empty hash table. Take your student number and split it into 4 2-digit integers. Insert each of these 2-digit numbers in the order in which they appear in your student number into the empty heap. Then insert the values...
Given the input sequence 4371, 1323, 6173, 4199, 4344, 9679, 1989, a hash table of size b=10, and a hash function h(x)=x mod b, show each step needed to build a hash table A closed hash table using double hashing, with the second hash function as h′(x)=7 − (x mod 7) This yields the sequence of hash functions hi(x)=(x mod b + i⋅ (7 − ( x mod 7)))mod b for i=0,1,…
Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x) = x (mod () 10), show the resulting: a. Separate chaining hash table b. Hash table using linear probing c. Hash table using quadratic probing d. Hash table with second hash function h2(x) = 7 - (x mod 7) *Assume the table size is 10.
3. (20 points) In open addressing with double hashing, we have h(k,i) hi(k)+ih2(k) mod m, where hi(k) and h2(k) is an auxiliary functions. In class we saw that h2(k) and m should not have any common divisors (other than 1). Explain what can go wrong if h2(k) and m have a common divisor. In particular, consider following scenario: m- 16, h(k) k mod (m/8) and h2(k)-m/2 and the keys are ranged from 0 to 15. Using this hash function, can...
11. Dra The size The hash function used is: the contents of the 13 hash tables below. Show your work for partial r hash table is HOk)-k mod 7 13, 17, 6, 24, 3 a) Resolve collisions with chaining b) Double hashing, where W20)-7-0mod 5) 0 1 1 2 2 3 3 4 4 5 5 6 6 c) What is the load factor for the table a? d) What is the load factor for the table b? f) Is...
Given the input of (2341,4234, 2839, 430, 22, 397, 3920;, and a fixed table size of 7, and a hash-function h1(x)-x mod 7, show the resulting a. Separate chaining hash-table b. Linear probing hash-table. c. Quadratic probing hash-table. d. Hash Table with second hash function h2(x)- (2x - 1) mod 7