- (a) ___ is a linear list of elements in which insertion and deletion take place from different ends.
- (b) Operations on a queue are performed in ___ order.
- (c) Insertion operation in a queue is called ___ and deletion operation is called ___.
- (d) Deletion of elements is performed from the ___ end of the queue.
- (e) Elements 'A','S','D' and 'F' are present in the queue and deleted one at a time; ___ is the sequence of elements received.
- (f) ___ is a data structure where elements can be added or removed at either end, but not in the middle.
- (g) A deque contains 'z','x','c','v' and 'b'. Elements received after deletion are 'z','b','v','x' and 'c'. ___ is the sequence of deletion operations performed on the deque.
(a) Queue is a linear list of elements with insertion and deletion at different ends. (b) Operations are performed in FIFO (First In, First Out) order. (c) Insertion is called enqueue, deletion is called dequeue. (d) Deletion happens from the front end. (e) Since a queue is FIFO, deleting one at a time returns them in the same order they were inserted: A, S, D, F. (f) This describes a Deque (Double-Ended Queue). (g) With the deque z-x-c-v-b (front to rear), tracing which end each received element came from: 'z' is deleted from the front; 'b' from the rear; 'v' (now at the rear of the remaining x-c-v) from the rear; 'x' (now at the front of x-c) from the front; and finally 'c' (the last remaining element). So the sequence of operations is: deleteFront, deleteRear, deleteRear, deleteFront, deleteFront (or deleteRear, since only one element remains).