subject

Create a hash function then test and evaluate the results. The set of strings are from a "words. txt" file (there are 45,402 words in the file, no repeating words. Map the words to 45,402 buckets using a hash function).Requirements:Create an array of 45,402 integers and initialize each to zero. These will be used to store how many times each index is produced from the hash function. Read each line of the input file (words. txt).Create a hash from each word using the hash function. Modulus the results of your hash function by 45,402 to get an index, and increment the appropriate bucket (array entry).After the entire file is processed, calculate and print the percentage on hashes that resulted in collisions (# of collisions / total strings hashed *100)The number of collisions can be obtained from the array at the end of the program. Any values >1 in the array indicate that a collision occurred on that index. For example, if theArray[102] = 3, that means two collisions occurred on index 102 because only one value should have been mapped there by a perfect hash function. Write the contents of the array to a file named hashresults. csv, then import it into a spreadsheet program and graph the results.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, kenken2583
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
image
Computers and Technology, 23.06.2019 22:40, azariah7
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
Answers: 1
image
Computers and Technology, 24.06.2019 12:30, nomood
Select all that apply. what two keys listed below should you use to enter data in an excel worksheet? tab backspace enter right arrow
Answers: 2
image
Computers and Technology, 24.06.2019 17:40, HealTheWorld
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately
Answers: 2
You know the right answer?
Create a hash function then test and evaluate the results. The set of strings are from a "words. txt...

Questions in other subjects: