Below is my code for problem 2 My problem is I have a txt fi

Below is my code for problem 2: My problem is I have a txt file which is the Hamlet play could someone please help me sort all the words in the hashtables by the most shown word which is supposed to be the and if two words have a tie to take the word that whichever letter it begins which is lower is put before. I need to also get rid of all the puncations such as the hyphens commas, [] () etc. Could someone please help??

And also could someone help me with problem one because we are supposed to make a hashtable from scratch with only about four methods.

Hashtable with Quadratic Probing Implement a Java class of hashtables using quadratic probing for collision resolution. The objects to be stored in the table are key-value pairs The keys are strings, and the values are integers The table sizes, m, are prime numbers. The first size should be 1031. Let n be the number of items in the table. When n m/2, you use the technique of dynamic arrays to enlarge the table You want to approximately double the table size but keep to the primes Use these primes: 2063 127, 8263, 16529, and 33071. You will not need larger primes for the purpose of this homework You may use Java String hashCode() as the hash function. The following is what you do for collision resolution. Let b be the hash value modulo m. If bucket b is occupied, you probe (b+12) m, (b-+22) m, (b- 32) m (b- 2)2) m, and stop as soon as you find an empty bucket. As long as n is kept less than m you will find an empty bucket by the end of the probing Use this page https docs oracle com avase/8/docs/api ava/util/Hashtable .html as a template for your class, but you do not need to implement all the methods. Implement as many as necessary to accomplish the following task 2 word Frequencies in a Text File Implement a Java program that counts word frequencies in a text file. Use a hashtable to store the data the words are the keys, and their frequencies are the values. The output of the program is the complete list of all the words and their frequencies in descending order of frequencies when two words have the same frequency, output them by alphabetical order. Each line of output consists of a word, a tab, and the frequency A sample input is \"The Tragedy of Hamlet, Prince of Denmark\", in the file Hamlet.txt. When processing the text, you should keep just the words, and discard all punctuation marks, digits, and so on. You also need to turn all upper case letters to lower cases.

Solution

Java program to implement hashtable Quadratic probing:

Below is my code for problem 2: My problem is I have a txt file which is the Hamlet play could someone please help me sort all the words in the hashtables by th

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site