Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C + + program that will simulate ADT stack / queue using a linked List ADT with actual pointers. The program will perform
Write a C program that will simulate ADT stack queue using
a linked List ADT with actual pointers. The program will
perform the following operation in the following sequence:
A Build a stack that consist of random integer numbers
that are and
B Build a queue that consist of random integer numbers
that are and
C Insert the element in the stack LIFO
D Remove the top two elements from the stack LIFO
E Insert element in the queue FIFO
Insert element in the location of the queue.
G Remove the first element from the queue FIFO
Remove the element from the queue.
I. Find Min and the Max elements in the queue.
Delete the entire stack.
K Remove the first element from the stack. An error
message should be displayed if the stack is empty.
L Delete the entire queue.
MRemove the last element from the queue. An error
message should be displayed if the queue is empty.
Repeat the process or enter to exit the program.
The entire list must be displayed After completion of each step
starting from A thru I, and The program must continue
running until the letter is entered.
Notes :
Validation must be done on the character that you enter to
repeat the process. Only capital letters are accepted to
terminate the program. Everything else should rerun the
program again.
Must use at least functions to handle the operations
M
Must place a header signature line at the beginning and
before terminating the program Look at the sample run
You are not allowed to use any types of arrays, any type of global
arrays. You are also not allowed to use global variables.
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