In a deque if insertion and deletion is done from the same end, it will behave as ________.
In a deque if insertion and deletion is done from the same end, it will behave as ________.
Solution
✅ Correct Option: 2
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 Last In First Out (LIFO), which is exactly how a stack behaves.
Option 1: A queue is First In First Out (FIFO), so insertion and deletion must happen at opposite ends, not the same end.
Option 4: The same-end operation gives only LIFO, so it cannot also act as a queue. It would behave as a queue only if insertion and deletion were done at opposite ends.
Related questions:
2026: 26 May Shift 1
2025: 22 May Shift 1