Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

General overview: Your main program should maintain three different data structures- queue, a stack, and a linked list. Your implementation of each data structure should

image text in transcribed
image text in transcribed
General overview: Your main program should maintain three different data structures- queue, a stack, and a linked list. Your implementation of each data structure should not impose a maximum number of values in each. The program will read a set of integers from a file and copy those values into all three data structures, using appropriate insert methods so that: The queue contents exactly match the order of values in the file, with the first value from the file at the front of the final queue. The stack contents are stored in the opposite order, since a stack is a last-in, first-out data structure. The top of the final stack will be the last value read from the file. The linked list contents should be ordered from lowest to highest value. Input: Your program takes input from two sources: Command line arguments: This program takes a single command line argument, the name of the text input file containing the integer list. See the lecture slides/recording from Monday, 2/1 for more details on reading command line arguments. If your executable name is progi, you might run it with command line: ./progi filel.txt File input. The input file contains a series of integer values, one per line. You can assume there will be no errors when reading the file contents. One sample file will be posted with the assignment, and the results of reading it are shown below. Output: After reading the file, your program should print the contents of all three structures. For the stack, start at the top of the stack; for the queue, start at the front of the queue. Each data structure's contents should be printed on a single line, with one space between values. For example, given the sample input file filel.txt posted with the assignment, your program should print the following lines of output: QUEUE CONTENTS: 48 10 57 30 -5 5 1 31 20 -9 STACK CONTENTS: -9 20 31 1 5 -5 30 57 10 48 LIST CONTENTS: -9 -5 1 5 10 20 30 31 48 57 2 Your submission must meet the following requirements: Your solution may be written in C or C++, You must submit an archive file (zip, tar, origz format only) containing: All source/header files you write. You should have at least three such files: A source file containing your main() function A header file for any structure/class definition(s) and function prototypes (if you use multiple structures/classes, you'll have multiple source files) . A source file for your function definitions (again, multiple structures classes means multiple source files) o Appropriate build files for your project either a makefile to be used with make, or appropriate files to be used with cmake (see details on page 3) O A README file that briefly describes the contents of your submission, as well as directions for compiling and running your code

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

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions

Question

Consider this article:...

Answered: 1 week ago