Question
Data Structures in C++ Please, can someone help me this. I have posted several times but not getting the right answer. Text file containing English
Data Structures in C++
Please, can someone help me this. I have posted several times but not getting the right answer.
Text file containing English words: http://staffwww.fullcoll.edu/aclifton/files/words.txt
Implementation
This assignment doesnt have a test runner. Just run each of the above hash functions through the full dictionary and then report on the pp value you get for each. You should get p=1p=1 for the really bad hash functions (indicating that they are very far from uniform) but p
This assignment is for my class server so you will probably need the links for some of the information below.
1. Text file containing 100000 English words: http://staffwww.fullcoll.edu/aclifton/files/words.txt
- You can just pretend that I downloaded the text file to my server and copied them to my code using an ifstream dictionary("word.txt");
2. This is the link for the full distribution if you would need them: https://sourceforge.net/projects/boost/files/boost/1.63.0/
In this assignment you are going to test various hash functions to see how good they are, in terms of how many collisions they have. Your input will be strings, in fact, all the strings that are defined in the systems dictionary. This is located in /usr/share/dict/words; you can download a copy to your local computer for testing here. (If you try to download it your browser may say that its a binary file, but it is in fact a text file, with one word per line.) Note that if you try to open the system copy of the dictionary in your code on the server, you will have to open it for reading only, otherwise opening the file will fail. This file contains just under 100,000 English words, which were going to use to test the uniformity of various hash functions. Your hash functions will hash strings into 16-bit (not 32-bit) int s. This is important, because we're going to keep a table of the number of collisions for each hash value. With 16-bit int s there are only 65,536 possible hash values, so this table will easily fit in memory. If we used 32-bit int s then there would be 4,294,967,296 possble hashes, a more troublesome amount. For C++, you can get a 16-bit unsigned int type by doing #includeccstdint> uint16.tx; 7x has exactly 16 bits, and is unsigned In this assignment you are going to test various hash functions to see how good they are, in terms of how many collisions they have. Your input will be strings, in fact, all the strings that are defined in the systems dictionary. This is located in /usr/share/dict/words; you can download a copy to your local computer for testing here. (If you try to download it your browser may say that its a binary file, but it is in fact a text file, with one word per line.) Note that if you try to open the system copy of the dictionary in your code on the server, you will have to open it for reading only, otherwise opening the file will fail. This file contains just under 100,000 English words, which were going to use to test the uniformity of various hash functions. Your hash functions will hash strings into 16-bit (not 32-bit) int s. This is important, because we're going to keep a table of the number of collisions for each hash value. With 16-bit int s there are only 65,536 possible hash values, so this table will easily fit in memory. If we used 32-bit int s then there would be 4,294,967,296 possble hashes, a more troublesome amount. For C++, you can get a 16-bit unsigned int type by doing #includeccstdint> uint16.tx; 7x has exactly 16 bits, and is unsignedStep 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