Suggest a table size for re-hashing a hash table of size 8? Of size 13?
Ans: size = 13, We should always take table size as a PRIME number
The reason why prime numbers are used is to minimize collisions when the data exhibits some particular patterns.
First things first: If the data is random then there’s no need for a prime number, you can do a mod operation against any number and you will have the same number of collisions for each possible value of the modulus.
But when data is not random then strange things happen. For example consider numeric data that is always a multiple of 10.
Suggest a table size for re-hashing a hash table of size 8? Of size 13?
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...
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...
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...
Insert the following IP addresses into a hash table of size 5 using universal hashing with a1 = 1, a2 = 2, a3 = 4 and a4 = 5.: 209.85.231.104 Google 207.46.170.123 Microsoft 208.80.152.2 Wikipedia
Insert the following keys into the following hash table, size 10: a. our hash function is simply key mod 10 b. Assume open hashing Keys: 566 909 212 655 123 444 974 321
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...
Suppose we are inserting strings into a hash table of size 9. Suppose we have two hash functions, h, and h2. The hash values for certain strings of these functions are shown in the table below: Fill in the hash table below assuming that we are using open-address, linear-probing style hashing, given that the table starts as it appears below, the hash function is h_1 and the order of insertion is "Fred", "Chloe", "Adam", "Rebecca" and "Reggie". Fill in the...
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
Use a table size of 13 for the following hash questions 1-4 and A given input of (3823, 8806, 8783, 2850, 3593, 8479, 1941, 4290, 8818, 7413} with a hash function h(x) = x mod 13.
10 points 10) Using Hopscotch hashing with a max hop of 4, hash the following keys. Table size is 15 A: 6 B: 7 c: 9 D: 7 E: 7 F: 6 G: 8
4. Hashing and Hash Tables. You need to use the ASCII table in the last page for this question. Study the following hash functions for ASCII C strings that are at least 3-char long unsigned hash1(const char, unsigned unsigned vto]+01997 return (v % m); unsigned hash2Cconst char unsigned) unsigned v-o]k(2] 877 return 1 + (v % ( -1)); (a) Given that m-, 7, compute the hash values and fill the following table (3%) String k hash1k, ) hash2(k, 7) aph...