Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this project, you'll take the hash table with separate chaining and modify it to implement containsKey ( ) using the ideas presented in the
In this project, you'll take the hash table with separate chaining and modify it to implement containsKey using the ideas presented in the modules.
class FHmapSC
Update the class with the following attributes and methods:
Methods:
ArrayList containsKeyKey requestedKey tests if the specified object is a requestedKey in this hash table. If found, returns the ArrayList of Value objects found. Otherwise, returns null.
Note: This method builds on top of the discussion question titled Searching for a Key in a Hash Table. However, the method return value is different. So make sure to update the method to return an list of objects.
class WordAssistant
Implement the class with the following attributes and methods:
Attributes:
Instance variable sequenceTable of type FHmapSC
Methods:
A constructor which takes an argument of type FHlinkedlist and fills the hash table with sequences of substrings term attribute.
For each Word object in the FHlinkedlist, create as many substrings as there are characters in term attribute. A sequence is substring of to n from term attribute.
The method findSequenceInTable which takes a String as the key into the sequenceTable. If the argument is found, returns an ArrayList. Otherwise returns null.
An accessor method for the attribute sequenceTable.
class Word
Note: This class has already been implemented for you.
An object of type Word stores sequence of chars and a description.
Attributes:
Instance variable term of type String. Store one sequence of chars as a String.
Instance variable description of type String. Stores the description read from the input file as is
class FileReader
Note: This class has already been implemented for you.
Utility class that reads a CSV files with the key, value format.
class SearchDestination
Tests the functionality of class FHmapSC and class WordAssistant.
Specifically checks for implementation of containsKey function to return an object associated with a given key input.
Instantiates a simple GUI that enables the user to search for a word. Uses Swing to create a JFrame where the user can enter their search.
The result of the search is displayed as a list of descriptions.
Your sequence table should like as below for the given input destination.txt file:
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