Question: In the java programming language: URL to download Plain Text UTF-8 : http://www.gutenberg.org/ebooks/2600 Write a program HashCodeSearch to search a file to see if you
In the java programming language:

URL to download "Plain Text UTF-8" : http://www.gutenberg.org/ebooks/2600
Write a program HashCodeSearch to search a file to see if you can find two words that have the same hash code. Read the file with a Scanner and use a data structure that maps the hashcode to a set of words with that hashcode. At the end print out words that have the same hash code on the same line in lexicographical order. (That will be any set with a length greater than 1) Finally print the number of duplicates divided by the number of words. It will be a really small number. That is the percentage of collisions Set the delimiter to use: scan.useDelimiter (" A-Za-z0-9 1+ The book to search is at the URL below. Download the plain text and save it in your roiect as "war and peace.txt". The book is War and Peace" - so there will be lots of words. (586,914). You can just declare that the main method throws FileNotFoundException. No need for a try/catch Write a program HashCodeSearch to search a file to see if you can find two words that have the same hash code. Read the file with a Scanner and use a data structure that maps the hashcode to a set of words with that hashcode. At the end print out words that have the same hash code on the same line in lexicographical order. (That will be any set with a length greater than 1) Finally print the number of duplicates divided by the number of words. It will be a really small number. That is the percentage of collisions Set the delimiter to use: scan.useDelimiter (" A-Za-z0-9 1+ The book to search is at the URL below. Download the plain text and save it in your roiect as "war and peace.txt". The book is War and Peace" - so there will be lots of words. (586,914). You can just declare that the main method throws FileNotFoundException. No need for a try/catch
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
