6. A hash table has size 7, uses quadratic probing (f(i) = 1), and has hash...
Let 'M' denote the hash table size. Consider the following four different hash table implementations: a. Implementation (I) uses chaining, and the hash function is hash(x)x mod M. Assume that this implementation maintains a sorted list of the elements (from biggest to smallest) for each chain. b. Implementation (II) uses open addressing by Linear probing, and the hash function is ht(x) - (hash(x) + f(i)) mod M, where hash(x)x mod M, and f(i)- c. Implementation (III) uses open addressing by...
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...
Use a hash table with a fixed size of 10. Don't grow the table or do any rehashing. Use the hash function H(x) = x % 10. Use Quadratic Probing to resolve collisions in part a, b and c: a) Insert the items into an initially empty hash table. Draw the table that results. 71 23 73 99 44 b) Draw the table that results from adding 79 to the table in part a c) Draw the table that results from...
Separate Chaining A hash table of size 7 uses separate chaining to resolve collisions. A polynomial hash function where a 33 is used. Sketch the table's contents after the following words have been added in the exact order shown: find, edge, body, race, plan, beat, they You may find it useful to create a list of lowercase letters and their ASCII numeric value. The letter a's value is 97 and z's value is 122. Linear Probing: A hash table of...
Show how the following data would be stored in a hash table of size 7 (the size is fixed) using quadratic probing. If any insertion fails, indicate that, but keep trying to insert all the remaining data. The hash function is hash(x) = x mod 7. Here is the data to be stored: 17, 10, 31, 45, 3, 53, 14. Insert the data in the order given. Data: Index: 0 1 2 3 4 5 6 4 data: Index: 31...
#3 [3 points] Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and quadratic probing is used to resolve collisions, after the following elements are inserted: 20, 42, 45, 49, 62, 72, 95. The probes are based on this equation: (H+c1∗i+c2∗i2)mod(N) and c1=1, c2=1. If direct hashing was used to store the same elements as the previous problems (20, 42, 45, 49, 62, 72, 95), what should be the minimum size of...
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...
(in Java) We wish to insert the following strings into a hash table: BEN AL SUE CHUCK KAREN MIKE SAM MIKE ALICE TARA TIM BOB Let's make the hash table size p=19 ( 19 is a prime ). Use letter encodings where A maps to 1, B maps to 2, etc and strings map to powers of 26. For example, "ABC" would map to 1*(26^2) + 2*(26^1)+ 3*(26^0) mod 19 (you might find the web site Wolfram Alpha helpful. Just...
3. Assume that you have a seven-slot hash table (the slots are numbered 0 through 6). Show the final hash table that would result if you used the following approach to put 7, 13, 10,6 into the hash (4 points each) the hash function h(k)-k mod 7 and linear probing function the hash function h(k)-k mod 7 and quadratic probing (a) (b)
05. 6 points) Complete the following hash table using closed hashing with quadratic probing.M- 19. Follow the sequence of insertions, searches and deletions in the operations table, filling in the sequence of probes and whether the operation succeeded. Hash Table Index Value Operation Insert Insert 2 Insert 26 Insert 46 Insert 83 Search 45 Search 29 Delete 46 Insert 6 Insert 102 Search 8 Probe Success? (YIN) 10 15 16 17 18 05. 6 points) Complete the following hash table...