Question: Write in C language, thanks. A deque is a data structure consisting of a list of items, on which the following operations are possible: Push(X,
Write in C language, thanks.

A deque is a data structure consisting of a list of items, on which the following operations are possible: Push(X, D): Insert item X on the front end of deque D. Pop(D): Remove the front item from deque D and return it. Inject(X, D): Insert item X on the rear end of deque D. Eject(D): Remove the rear item from deque D and return it. Write routines to support the deque that take O(1) time per operation. Your main program will print out the items in deque after each operation. Deque can have at most 30 items. Sample input data format: Nop Op X Op/* Nop is the num of operations to be performed, and Op is the operation # with or without an operand (e.g. 1 - Push, 2 - Pop, 3 - Inject, 4 - Eject). One example of input sequence is shown below: 5 1 3 3 7 2 3 2 4 Sample output data format: Push: 3 Inject: 3 7 Pop: 7 Inject: 7 2 Eject: 7 Only integer operand is used./*
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
