Description
Submission Format
Assignment
Problems
Linear Search: A Linear Search begins on one side of an ordered list and examines each element sequentially to determine if and where the desired search element exists within the list. When the desired element is found in the list, the index where the element is located will be returned. If the element is not found in the list, -1 will be returned.
Complete the class OurDictionary, found in the file HW5.java by implementing the following methods:
Ø public void addWord(Word word): adds a word to the list of words.
Ø public int linearSearchIterative(Word word): implements the Linear Search algorithm iteratively.
HW5Driver is given to you to assist in your testing [a stub for the class OurDictionary is included at the bottom of the HW5Driver.java so that HW5Driver will compile as-is].
You will be using Word objects, and the class Word provides access to useful methods such as equals – allowing you to compare the equivalence of two words.
The classes: LetterMap, Position, and Tile are provided so that the class Word will compile. Note, this class structure is based upon a solution to the game Scrabble. Recall, when playing Scrabble, you would keep track of a set of tiles which combined together to form words.
Comparing words to the list in a dictionary would validate the usage of a given word.
Reviews
There are no reviews yet.