Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

General overview: Your main program shoid maintain three different data structure 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 shoid maintain three different data structure queue, a stack, and a linked list. Your implementation of each data structure should not impose maximum number of values in each The program will read a set of integers from a file and copy these 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 opposae order, since ak is a last-in, first-out data structure. The top of the final stack will be the last value road from the file The linked list contents should be ondered 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 des recording from Monday, 2/1 for more details on reading command line argument If your executable name is progi, you might run it with command line ./progi Tilel.txt File input. The input file contains a series of integer values, one per line. You can there will be no erroes when reading the file contents. Ons sample file will be posted with the assignment, and the results of reading it arc 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 the front of the queue Each data structure's contents should be printed on a single lime, who puce between values For cumple, given the sample input file tilel.txt posted with the sigamentyour program Jould print the following lines of output QUEUE CONTENTS: 10 57 30-55 1 31 20 - STACK CONTENTS -9 20 31 1 5 -5 10 57 10 46 LIST CONTENTS: - 9 -5 1 5 10 20 30 21 48 57 Your submission must meet the following requirements: Your solution may be written in Cor Ch. You must submit an archive file (zier or not format el containing All source header files you write. You should have at least three such files: A source file containing your nain() 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) Appropriate build files for your project either a makefile to be used with make. or appropriate files to be used with emake (see details on page 3) A README file that briefly describes the contents of your submission, as well as directions for compiling and running your code General overview: Your main program should maintain three different data structures a 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 progl, 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 crrors 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

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 Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

LO1 Explain how the workforce is changing in unpredicted ways.

Answered: 1 week ago

Question

LO6 List the components of job descriptions.

Answered: 1 week ago