for this Java ( Hash table implementation ) use this Entry.java and SimpleList.j
ID: 3813755 • Letter: F
Question
for this Java (Hash table implementation) use this Entry.java and SimpleList.java to read a text file which do not have punctuation( no integer or punctuation mark)
You may not use any built-in Java data structures. This includes ArrayList, Map, Set, among other.
The only data structure that you can use in your implementation is a basic array.
you will be implementing a word count generator using a text file without punctuation( no integer or punctuation mark). You will implement one solution using a SimpleList and another solution using your own custom designed HashTable. Your program should parse the given text file and generate a histogram of the counts of each word in the text file. Be sure to deal with different letter cases in your implementation, (i.e. Java, JAVA, java should all be considered the same word). Use the Entry class given to store a word and its respective word count. You will need to implement the hashCode() function of the Entry class. This function should generate a hashCode() based on the word of the Entry. Please implement JFileChooser to select the input file.
-------------------------------------------------------------------------------------------------
HashTable Guidelines
Implement your HashTable (Please call the class HashTable) in any way you see fit.
Your table should keep track of a Load Factor. When the computed load factor is higher than the threshold you decide upon, you will need to resize and rehash your table.
Think very carefully about what the initial size of the table should be, the initial size is not allowed to be anything over 20 to start.
When you have to resize your table, think very carefully about what the new size should be.
You may NOT use separate chaining.
For open addressing you can use linear or quadratic probing, or double hashing.
-----------------------------------------------------------------------------------------
Hash Functions
For the primary hash function ( h(word) ), use the formula for hashing a string (from the lecture notes). Use 31 for the value of b in the formula.
For the secondary hash function ( h`(word) ) (if you choose to use double hashing). Take the result of the first hash function and use it in the following formula:
h(word) gives you the result of the primary hash function from the lecture notes.
h`(word) = 7 - (h(word) % 7)
Think very carefully where the primary (and optionally secondary) hash functions should go.
------------------------------------------------------------------------------------------
Test Class Requirements
Please provide a HashTableTest class with the following two static methods.
Please provide a method called generateSimpleList() which takes no parameters and returns the unsorted, populated SimpleList.
Please provide a method called generateHashTable() which takes no parameters and returns the unsorted, populated HashTable.
------------------------------------------------------------------------------------------
Results (Output)
The program should generate a text file that includes the output of your populated SimpleList. It should very cleanly show the data of each entry (word and its count). The output should be sorted alphabetically. (Do not include the sorting in the time measurement.)
The program should generate a second text file that includes the output of your populated HashTable. It should very cleanly show the data of each entry (word and its count). The output should be sorted alphabetically. (Do not include the sorting in the time measurement.)
The program should calculate the time it takes each implementation (SimpleList vs HashTable) to complete the population.
NOTE: For accurate measurements you cannot process both populations at the same time. You will need to do two separate file reads / processing to give a fair and accurate measurement.
Be sure that you do not perform any console writing or file writing in the methods which generate the SimpleList and HashTable. This will slow down your algorithm significantly.
The program should also show the number of entries in the populated SimpleList and the number of entries in the populated HashTable.
------------------------------------------------------------------------------------------
please use to measure runtime
java.time.Duration;
java.time.Instant;
example:
------------------------------------------------------------------------------------------
Entry.java
plz read carefulm only implement in last method
------------------------------------------------------------------------------
and also this one
-----------------------------------------------------------------------------
Explanation / Answer
#include
#include "w7integer.h"
using std::cout;
int main()
cout << total << ' ';
return 0;
}
// w7integer_subtract.cpp
#include
#include "w7integer.h"
using std::cout;
int main() ;
string val2[] = ;
for (int i = 0; i < 7; i++)
compare(val1[i], val2[i]);
string s[] = ;
for (int i = 0; i < 5; i++)
testbool(s[i]);
}
// w7integer_zero.cpp
#include
#include "w7integer.h"
using std::cout;
int main() a pair of << ' ' << three * i << ' ' << i*i + four << ' ';
string val1[] = ;
string val2[] = ;
for (int i = 0; i < 10; i++)
return 0;
}
// w7integer_divide.cpp
#include
#include "w7integer.h"
using std::cout;
int main() > i) {
cout
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.