Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code creates an LPHashTable and sets the hash weights to { 0 , 1 , 2 , 3 , 4 , 3 , 2

The code creates an LPHashTable and sets the hash weights to {0,1,2,3,4,3,2,1,0} in that order.
This task concerns compung weights that opmise inseron of a specific list of names in an
LPHashTable. Inseron is opmised if it uses the least number of probes. There may be more than
one combinaon of weights that achieve this.
1. On the assignment page you will find a program called DataMaker.java. You will use this to
generate your personal custom list, , of 36 usernames from students.txt.
2. You will then write a program called Optimize.java that, for every possible combinaon of
weights, evaluates the number of probes required for inseron of usernames in an
LPHashTable of size 37. It will output a single line containing two integers: (a) the least number of
probes required, and (b) the number of weight combinaons that achieve this. Thus if the
output is
444
then the least number of probes to insert all the usernames was 44, and there were 4 different
combinaons (sets of 9 weights) that achieved a probe count of 44.
The DataMaker program accepts two command line inputs: (i) YOUR username, and (ii) the
number of usernames required in :
java DataMaker
It will generate list , outpung it to the screen. You should use file redirecon to pipe this to a file
called mydata.txt. Your Optimize program will read in this file.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions