How linked lists work in the book

Assignment Help Data Structure & Algorithms
Reference no: EM131963712

Assignment: Linked Lists

In this assignment, you will be reading in words from a pronunciation dictionary to figure out which words rhyme with each other.

To do this, you will be implementing MyLinkedList and MySortedLinkedList. Besides the lectures in class, you can read much more about the code details of how linked lists work in the book on pages 249-268.

You'll be implementing the following:

? A linked list in MyLinkedList that implements interface . You'll be using in two different ways, to store a list of and to store a list of within each object. More on this below.

? Code in the main method of that takes lines that have been read from a rhyming dictionary and stores them in the lists.

? A subclass of MyLinkedList called MySortedLinkedList , that has a method for adding items into the list in sorted order.

? Code in the main method of RhymingDict that takes pairs of words specified on the command line and outputs whether they rhyme or not.

A LinkedList is useful for storing information when you don't know how many items you need to store. In this lab, we will be iterating through a rhyming dictionary and storing words together according to their rhyming group, which is the most heavily emphasized part of their pronunciation.

In the directory of starter code for the assignment, you'll see a subdirectory called cmudict . Inside is a file called cmudict- short .dict. Opening this, you'll see lines like:

The letters after the words represent the phonemes (units of sound) you speak when you pronounce the word. The phonemes that have numbers after them (0, 1 or 2) are the emphasized phonemes, with phonemes marked with 2 having the most emphasis (say the words out loud to yourself to try this out). Two words rhyme if the share the same subset of phonemes after the most emphasized phoneme. For example:

ListInterface
MyLinkedList
RhymeGroupWords
Strings
RhymeGroupWords
RhymingDict
dignitary D IH1 G N AH0 T EH2 R IY0

necessitate N AH0 S EH1 S AH0 T EY2 T

undue AH0 N D UW1

moderated M AA1 D ER0 EY2 T IH0 D

moderated M AA1 D ER0 EY2 T IH0 D

anticipated AE0 N T IH1 S AH0 P EY2 T IH0 D

both rhyme, and they both share EY2 T IH0 D starting with the most emphasized phoneme. The EY2 T IH0 D is called the rhyming group for these two words. You'll be storing rhyming groups in a linked list of RhymeGroupWords , a class you've been provided in the starter code. Each object stores a string with the rhyme group and a list of words that share the rhyme group (a variable of type ). So you'll be using linked lists in two different ways: to store a list of RhymeGroupWords , and, within each RhymeGroupWords object, to store a list of words.
RhymingDict

The file RhymingDict.java is provided for you. It already has the following:

RhymeGroupWords
getRhymeGroup(String line)

? A method from the dictionary. For example IH0 D" ) returns, which returns the rhyme group for a line, which returns the word for a line from the dictionary.

ListInterface

getRhymeGroup( "moderated M AA1 D ER0 EY2 T

? A method For example,

"EY2 T IH0 D"

getWord(String line)

getWord( "moderated M AA1 D ER0 EY2 T IH0 D" )

returns, which returns a S tring[] of all the lines from the

1. Use your implementation of MyLinkedList to create a linked list of RhymeGroupWords , one for each unique rhyme group you encounter (there are 8 unique rhyme groups in cmudict-short.dict ). Within each RhymeGroupWords you'll store a MySortedLinkedList of words that share that rhyme group.

2. Iterate through pairs of arguments to RhymingDict and use your linked list to determine if the pair of words rhyme. For example, with the command:

java RhymingDict crumbling mumbling collections abbreviated vegetate mutate

the output would be:

In the case of the last pair of words, and , since the word doesn't appear in cmudict-short.dict , it reports that and ignores "vegetate" . If an odd number of words is passed on the command line, it ignores the last word (since it's not part of a pair).

Do not use built-in Java data structures (like ArrayList or LinkedList) in this file

"moderated"

pronunciation dictionary.

loadDictionary()

? A method

The tasks you have to do is marked with the comment TODO in the main method of

EY2 T IH0 D

RhymingDict . These tasks are:

crumbling and mumbling rhyme

collections and abbreviated don't rhyme

mutate is not in the dictionary

"vegetate"
"mutate"
"mutate".

Attachment:- Assignment-Rhyming-Linked-List.rar

Reference no: EM131963712

Questions Cloud

Find the present value : Find the present value and explain whether or not you would invest in the project, if you are asked to pay $5, 500 to be able to participate.
How much does the equilibrium level of output? fall : If the consumption function is C? = 100? + 0.95Y and planned investment spending is 500?, what will be the equilibrium level of? output?
Discuss the bcp strategies discussed in the video : Research and provide your recommendations be for the Business Continuity Management Team (BCMT) for a University Library?
How much is the present value of the perpetual fee to bank : How much is the present value of the perpetual fee to the bank?
How linked lists work in the book : Besides the lectures in class, you can read much more about the code details of how linked lists work in the book on pages 249-268.
How much is the ear for this factor : The factors discount is 3%. How much is the EAR for this factor?
Research and recommend a cmp approach for a university : Research and find at least three (3) approaches for developing a CMP. Research and recommend a CMP approach for a University.
Determining the firm total cost : If the firm produces 450 boots, then the firm's total cost is more than $90,000t, true or false?
What is the estimated enterprise value of target : What is the estimated enterprise value of Target Inc. using the weighted average valuation approach?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd