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

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 19:30
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
question
Computers and Technology, 23.06.2019 20:00
What multimedia system creates an immersive, real-life experience that the user can interact with?
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Aman travel 200m towards east< br /> from his house then takes left< br /> to turn and moves 200 m north< br /> find the displacement & distance.< br />
Answers: 3
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
question
Mathematics, 05.07.2019 01:30
question
Mathematics, 05.07.2019 01:30
Questions on the website: 13722363