Answered step by step
Verified Expert Solution
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.
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started