Code in C, Implement a C program using the stack and queue operations Code a stack and queue test driver. A test driver is a program created to test functions that are to be placed in a library. Its primary purpose is to completely test functions; therefore, it has no application use. The functions to be tested are push stack, pop stack, enqueue, and dequeue. You may include other stack and queue functions as required. All data should be integers. You need two stacks and two queues in the program, as described below. a. Input stack: used to store all user input b. Input queue: used to store all user input c. Output stack: used to store data deleted from input queue d. Output queue: used to store data deleted from input stack Use a menu-driven user interface that prompts the user to select either insert or delete. If an insert is requested, the system should prompt the user for the integer to be inserted. The data are then inserted into the input stack and input queue. If a delete is requested, the data are deleted from both structures: the data popped from the input stack are enqueued in the output queue, and the data dequeued from the input queue are pushed into the output stack. Processing continues until the input structures are empty. At this point print the contents of the output stack while deleting all of its data. Label this output "Output Stack", then print all of the data in the output queue while deleting all of its data. Label this output "Output Queue."
Code in C, Implement a C
Code a stack and queue test driver. A test driver is a program created to test functions that are
to be placed in a library. Its primary purpose is to completely test functions; therefore, it has no
application use. The functions to be tested are push stack, pop stack, enqueue, and dequeue.
You may include other stack and queue functions as required. All data should be integers. You
need two stacks and two queues in the program, as described below.
a. Input stack: used to store all user input
b. Input queue: used to store all user input
c. Output stack: used to store data deleted from input queue
d. Output queue: used to store data deleted from input stack
Use a menu-driven user interface that prompts the user to select either insert or delete. If an
insert is requested, the system should prompt the user for the integer to be inserted. The data
are then inserted into the input stack and input queue. If a delete is requested, the data are
deleted from both structures: the data popped from the input stack are enqueued in the output
queue, and the data dequeued from the input queue are pushed into the output stack.
Processing continues until the input structures are empty. At this point print the contents of the
output stack while deleting all of its data. Label this output "Output Stack", then print all of the
data in the output queue while deleting all of its data. Label this output "Output Queue."
Trending now
This is a popular solution!
Step by step
Solved in 5 steps