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, 22.06.2019 12:10
1. declare a constant named cents_per_pound and initialize with 25. 2. get the shipping weight from user input storing the weight into shipweightpounds. 3. using flat_fee_cents and cents_per_pound constants, assign shipcostcents with the cost of shipping a package weighing shipweightpounds.
Answers: 2
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 22.06.2019 23:00
Which factor is the most important when choosing a website host? whether customers will make secure transactions the number of email accounts provided the purpose of the website the quality of the host control panel
Answers: 3
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
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
Engineering, 16.10.2020 22:01