GK Question

technology medium mcq

Which data structure allows insertion and deletion from both ends?

  1. Stack
  2. Queue
  3. Deque
  4. Array

Answer: Deque

Deque (Double-Ended Queue) allows insertion and deletion at both front and rear ends, combining features of stack (LIFO) and queue (FIFO). Implemented using arrays or linked lists. Used in palindrome checking, sliding window problems, and browser history management. Time complexity: O(1) for end operations.

Topic Database & Programming
Exam Relevance SSC JE, Banking IT, Railway