Question: [ 4 Marks ] Write a code to create generic data structure called deque which consists of a list of items. The following operations are

[4 Marks]
Write a code to create generic data structure called deque which consists of a list of items. The following operations are performed in deque
a. push (x) : Insert item x on the front of the deque.
b. pop() : Remove the front item from the deque and return it.
c. inject (x) : Insert item x on the rear end of the deque.
d. eject(x): Remove the rear item from the deque and return it.
[ 4 Marks ] Write a code to create generic data

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!