Starting from:
$30

$24

Homework #4 Solution

In this Homework, you are going to write a program that implements a doubly linked list.




The data in both txt files must be read from the files.




Letters.txt contains 26 English Letters (You can write the file specification into your program instead of receiving the file name from command line.):.




A




B




C




D









Z




Sequence.txt contains a list of numbers (You can write the file specification into your program instead of receiving the file name from command line.)




3,-3,19,-19,18,1,-2,3,-18,17,1,-3,-13,14




You need to




Create a doubly linked list by reading the 26 letters from Letters.txt.



Sequence.txt file contains a sequence of relative letter positions. Suppose the listData points to the first element in the doubly linked list. The first letter I want to output is the third forward element from the beginning. Then the second letter is the third element backward from the current position. You need to output all letters indicated in sequence.txt






Your job




Create a doubly linked list



Implement putItem() method



Correctly read the files and interpret the information



Print out the letters






Requirements:




[will be 0 if it does not compile or crash] The homework must be done in C++. Although you can use any IDE to do the homework, your code must work under Code::Blocks since the
CS 3240 Data Structures and Algorithms







grader will use it to grade your homework. You are not allowed to use Standard Template Library to create the linked list.




[5%] The Following identification information must be included at the beginning of your cpp file.



//Name: XXXXXXX




//Email: XXXX@csueastbay.edu




[40%] Must use Doubly Linked List



[45%] Must use relative positions to calculate the output using next and back points in the doubly linked list and correctly output the results



[10%] Correct I/O of the data file. You can put file names into the code instead of reading from command line. The content of the files must be read via file I/O.

More products