Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java: I need help writing a HashtableExperiment.java class, which makes use of HashTable.java ( an abstract class ) , HashObject.java, LinearProbing.java ( h 1

In java:
I need help writing a HashtableExperiment.java class, which makes use of HashTable.java (an abstract class), HashObject.java, LinearProbing.java (h1(k)= k mod m), DoubleHashing.java (Primary : h1(k)= k mod m; secondary hash function is h2(k)=1+(k mod (m 2)) mod m), TwinPrimeGenerator.java (to find the size of the Hashtables using a twin prime between 95500 and 96000)
HashtableExperiment.java has the following usage:
Usage: java HashtableExperiment []
: 1==> random numbers
2==> date value as a long
3==> word list
: The ratio of objects to table size,
denoted by alpha = n/m
: 0==> print summary of experiment
1==> save the two hash tables to a file at the end
2==> print debugging output for each insert
Word List is a long txt file with a word on each line.
When saving the hash tables to a file, the format should be as follows (where the two numbers after the key are the number of duplicate keys and the probe count for the first key inserted.)
table[95781]: equivocates 01
table[95786]: gryphon 541
table[95787]: frank'd 11
Printout of summary should look like this:
HashtableExperiment: Found a twin prime table capacity: 95791
HashtableExperiment: Input: Word-List Loadfactor: 0.50
Using Linear Probing
HashtableExperiment: size of hash table is 47896
Inserted 1305930 elements, of which 1258034 were duplicates
Avg. no. of probes =1.60
Using Double Hashing
HashtableExperiment: size of hash table is 47896
Inserted 1305930 elements, of which 1258034 were duplicates
Avg. no. of probes =1.39

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago