Answered step by step
Verified Expert Solution
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
:
Via XGo applicationsee course home page for details
of
EECEEECE: Operating Systems Individual Program
Instructor: M Geiger
UNIX Basics & Data Structure Review
Specification
General overview: Your main program must maintain three different data structuresa 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 lastin firstout 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 prog 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 file your program should print:
QUEUE CONTENTS:
STACK CONTENTS:
LIST CONTENTS:
EECEEECE: Operating Systems
Instructor: M Geiger
Individual Program
UNIX Basics & Data Structure Review
xythos.content.blackboardcdn.com
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started