Question: 8 : 4 8 Via X 2 Go application - see course home page for details 2 of 3 EECE . 4 8 1 1

8:48
Via X2Go application-see course home page for details
2 of 3
EECE.4811/EECE.5811: Operating Systems Individual Program 1
Instructor: M. Geiger
UNIX Basics & Data Structure Review
Specification
General overview: Your main program must maintain three different data structures-a queue, a stack, and a linked list. Your implementation of each structure should not limit the number of values it stores. You may use C++ STL classes if you want.
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 stack is 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. We discussed command line arguments in detail in class.
If your executable name is prog1, you might run it with command line:
./progl 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. Start at the top of the stack and the front of the queue when displaying output from those structures.
Print each data structure's contents on a single line, with one space between values.
For example, given the sample input file file1.txt, your program should print:
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
EECE.4811/EECE.5811: Operating Systems
Instructor: M. Geiger
Individual Program 1
UNIX Basics & Data Structure Review
-xythos.content.blackboardcdn.com
 8:48 Via X2Go application-see course home page for details 2 of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!