Double ended Queue implementation in C
It is called deque . You can add or delete data in both the ends. It can be implemented by arrays or linked list . Key terms: Front: it represents the first element. Rear: it denotes the last element. Operations: Insert the data in front end. Delete data in front end. Insert the data in rear end. Delete the data in rear end. Display the elements. Let us implement the deque in C as follows. #include <stdio.h> #define MAX 9 int deque[MAX]; int d_front = -1, d_rear = -1; void insert_Front(int x) { if ((d_front == 0 && d_rear == MAX-1) || (d_front == d_rear+1)) { printf("Deque is full with data elements.\n"); return; } if (d_front == -1) { d_front = d_rear = 0; } else if (d_fr...