Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

must be down in c language and on linux mint HW-10 CS230 10 points Due: April 16, 2018 In 1881 In Dodge City, Kansas, Bat

must be down in c language and on linux mint

image text in transcribed

HW-10 CS230 10 points Due: April 16, 2018 In 1881 In Dodge City, Kansas, Bat Masterson fights his last gun battle. And, in 1935 Babe Ruth's first National League game (Boston Braves), included a homerurn Write a program that uses a pointer-based linked list to manage a spell checker/translator. 1. Your program must read in each line of the input file (hw10data.txt) and put each word into a separate link of a pointer based linked list. For each word, you need to create a link that can hold that word precisely (i.e. the payload section must be sized specifically for each word) In other words, your structure for the linked list CANNOT look 1ike this: struct node f char word [n]; struct node next; It *MUSTlook like this: struct node f char word struct node "next; The difference is that in the required form, there is no space allocated for the text. You will have to use malloc/calloc to allocate that space 2. You need to create a second word linked list that contains the "correct" word for each word in the hw10data.txt file. By "correct,I mean a word that when it replaces the matching word in the hw10data.txt file the poem makes sense. We will call this the codex file 3. Your program must read in each word of the codex file (hw10codex.txt) and put each word into a separate link of a pointer based linked list. For each word, you need to create a link that can hold that word precisely (i.e. the payload section must be sized specifically for each word) In other words, the same rules apply for this linked list as in the first 1inked-list. Your structure for the linked list MUST look 1ike this: struct codex char word1 char "word2; struct codex *next; At this point you MUST have 2 linked list:s 4. You must traverse the hw10data linked list replacing each word with the translated word from the hw1ecodex linked 1ist. In some cases the existing word will be removed (e.g. "plane" "lee" may become "plainly" so "lee" must be removed from the linked list). In other cases the codex word may be longer or shorter than the original word, in these cases the original link must be deleted and replaced with a new link. This guarantees that the memory consumption will be optimal/minimal. You can do this with every replaced word if you 1ike. You CANNOTsimply create a third linked list, you are only allowed to have 2 linked lists, in total. 5. You must traverse the hw10data linked list displaying the corrected poem. The display MUST have the same exact format as the hw10data.txt file HW-10 CS230 10 points Due: April 16, 2018 In 1881 In Dodge City, Kansas, Bat Masterson fights his last gun battle. And, in 1935 Babe Ruth's first National League game (Boston Braves), included a homerurn Write a program that uses a pointer-based linked list to manage a spell checker/translator. 1. Your program must read in each line of the input file (hw10data.txt) and put each word into a separate link of a pointer based linked list. For each word, you need to create a link that can hold that word precisely (i.e. the payload section must be sized specifically for each word) In other words, your structure for the linked list CANNOT look 1ike this: struct node f char word [n]; struct node next; It *MUSTlook like this: struct node f char word struct node "next; The difference is that in the required form, there is no space allocated for the text. You will have to use malloc/calloc to allocate that space 2. You need to create a second word linked list that contains the "correct" word for each word in the hw10data.txt file. By "correct,I mean a word that when it replaces the matching word in the hw10data.txt file the poem makes sense. We will call this the codex file 3. Your program must read in each word of the codex file (hw10codex.txt) and put each word into a separate link of a pointer based linked list. For each word, you need to create a link that can hold that word precisely (i.e. the payload section must be sized specifically for each word) In other words, the same rules apply for this linked list as in the first 1inked-list. Your structure for the linked list MUST look 1ike this: struct codex char word1 char "word2; struct codex *next; At this point you MUST have 2 linked list:s 4. You must traverse the hw10data linked list replacing each word with the translated word from the hw1ecodex linked 1ist. In some cases the existing word will be removed (e.g. "plane" "lee" may become "plainly" so "lee" must be removed from the linked list). In other cases the codex word may be longer or shorter than the original word, in these cases the original link must be deleted and replaced with a new link. This guarantees that the memory consumption will be optimal/minimal. You can do this with every replaced word if you 1ike. You CANNOTsimply create a third linked list, you are only allowed to have 2 linked lists, in total. 5. You must traverse the hw10data linked list displaying the corrected poem. The display MUST have the same exact format as the hw10data.txt file

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

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions