Question: write code JAVA Exercise 3 : The load factor is defined as alpha = N / M , where N is the size of the
write code JAVA Exercise :
The load factor is defined as alpha NM where N is the size of the input the number of keys and M is the output size the hashtable If alpha is small, ie the hash table is large, there will be fewer chances of collision.
Modify your code in Exercise to do the following:
Set alpha to which means M N Use a random input and fill the hash table.
Generate a random key and search it in the hash table. Count the number of comparisons
you had to make regardless the search was successful or not
Do step the search operation several times at least times for a different key in the
same hash table. Every time note down the number of comparisons.
Write the number of comparisons in table form and their average in the space provided
below.
Iteration #
# of comparisons xxx
xxx xxx
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
