In a deque, if any insertion and deletion of elements is done from the same end, it will behave as____________ .
In a deque, if any insertion and deletion of elements is done from the same end, it will behave as____________ .
Solution
✅ Correct Option: 1
A deque (double-ended queue) allows insertion and deletion at both the front and the rear. If both operations are done at the same end, the element added last is the first one removed. This is LIFO (Last In, First Out) behaviour, which is exactly how a stack works.
Queue: needs insertion at one end and deletion at the other end (FIFO), so it is the opposite of using the same end.
A deque used at both ends can imitate a queue or a stack, so the same-end condition is what decides it.
Related questions:
2026: 19 May Shift 1
2026: 18 May Shift 2
2025: 13 May Shift 2