Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

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

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

Are you at your best around 8 or 9 AM? Yes No

Answered: 1 week ago