COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
same size as the amount of data to hold
|
|
an odd number
|
|
an even number
|
|
a prime number
|
Detailed explanation-1: -But a good general “rule of thumb” is: The hash table should be an array with length about 1.3 times the maximum number of keys that will actually be in the table, and. Size of hash table array should be a prime number.
Detailed explanation-2: -Using primes for hash tables is a good idea because it minimizes clustering in the hashed table.
Detailed explanation-3: -The hashing functions return a 128-bit, 160-bit, 256-bit, or 512-bit hash of the input data, depending on the algorithm selected. An expression that represents the string value to be hashed.
Detailed explanation-4: -The size of a hash table should always be an odd number. 14. Using a hash table size that is a prime number distributes values through the index range better than if the size is an even number.
Detailed explanation-5: -Double hashing requires that the size of the hash table is a prime number. Using a prime number as the array size makes it impossible for any number to divide it evenly, so the probe sequence will eventually check every cell.