Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i Need help to solve this. Question 2: Hash Table Implementations of a Dictionary Read through all of the instructions for question 2 before beginning,

i Need help to solve this.
image text in transcribed
image text in transcribed
image text in transcribed
Question 2: Hash Table Implementations of a Dictionary Read through all of the instructions for question 2 before beginning, and refer back to these instructions frequently to ensure you have completed all required details. In this question you will create two new implementations of a dictionary, to be used with the Scrabble word generator from Assignment 2. Both dictionary implementations will use a hash table to store the contents of the dictionary as described below. The first implementation will use open addressing, with double hashing to resolve collisons. The second implemen- tation will use separate chaining. Details specific to each hash table are listed in separate sections below. A modified version of the main class from Assignment 2 is provided. The provided file A402ProvidedCode.j contains code that will generate combinations of letters, calculate the points for each word, and determine a best It performs the search for the best word twice, once with each type of dictionary, and outputs the result of each search. Do not make any modifications to the provided code. You will only write the Dictionary classes (and any supporting classes they require) that will be used by the main method. The provided code uses the words.alpha.txt file from assignment 2 (obtained from https://github. com/duyl/english-vords). Place a copy of this file in your working directory. Begin by reviewing the provided code, noting how the dictionary classes are called in the main and supporting methods. In order to be compatible with the provided code, your dictionary classes must be named DictionaryOpen and DictionaryChain. Each dictionary class must have the following methods, which can be called from outside the dictionary class. Use additional (private) helper methods as appropriate . A constructor that accepts an integer indicating the initial size of the dictionary. That is, public DictionaryOpen (int size) for the dictionary using open addressing, and public DictionaryChain(int size) for the dictionary using separate chaining e public int getsize O: Return the number of words in the dictionary e public void insert (String nerword): Insert the given word into the dictionary. If a word already exists in the dictionary do not add it

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago