Question
[C++] are there any issues with the following hash functions? A. hash table has size 10,000. search keys are integers in range 0..999,999. the hash
[C++] are there any issues with the following hash functions?
A. hash table has size 10,000. search keys are integers in range 0..999,999. the hash function is:
h(key) = (key * rand()) % 10,000, where rand() is a function that returns a random float between 0 and 1 B.
hash table has size 2048. search keys are plant varieties. the hash function is:
h(key) = (position in alphabet of first letter of key) % 2048
h(key) = (sum of positions in alphabet of key's letters) % 2048
hash table has size 10,000. search keys are integers in range 0..9,999. the hash function is defined by the C++ function:
int hashIndex(int x) { for (int i=1; i<=10000; i++) x = (x*x) % 10000; return x; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started