arrow
arrow
arrow
A linear data structure in which insertion and deletion operations can be performed from both ends is __________.
Question



A linear data structure in which insertion and deletion operations can be performed from both ends is __________.

A.

queue

B.

circular queue

C.

deque

D.

More than one of the above

E.

None of the above

Correct option is C


A deque (double-ended queue) is a linear data structure that allows insertion and deletion from both the front and rear ends. It is a generalization of a queue where elements can be added or removed from either end.
Important Key Points:
1. What is a Deque?
· A deque (double-ended queue) allows insertion and deletion from both ends.
· It can be used in scheduling, caching, and sliding window algorithms.
· Two types of deques:
· Input-Restricted Deque – Insertion from one end, deletion from both ends.
· Output-Restricted Deque – Deletion from one end, insertion from both ends.
2. A deque can be efficiently implemented using doubly linked lists or dynamic arrays.
3. Deques are used in algorithms like BFS (Breadth-First Search), caching mechanisms and undo-redo functionality.
Knowledge Booster:
· Python provides a built-in collections.deque for optimized double-ended queue operations.
· (a) Queue → ❌ Incorrect: A queue follows FIFO (First In, First Out) and allows insertion only at the rear and deletion only from the front.
· (b) Circular Queue → ❌ Incorrect: A circular queue allows wrapping around of elements but does not allow insertion and deletion from both ends like a deque.

Free Tests

Free
Must Attempt

UPTET Paper 1: PYP Held on 23rd Jan 2022 (Shift 1)

languageIcon English
  • pdpQsnIcon150 Questions
  • pdpsheetsIcon150 Marks
  • timerIcon150 Mins
languageIcon English
Free
Must Attempt

UPTET Paper 2 Social Science : PYP Held on 23rd Jan 2022 (Shift 2)

languageIcon English
  • pdpQsnIcon150 Questions
  • pdpsheetsIcon150 Marks
  • timerIcon150 Mins
languageIcon English
Free
Must Attempt

UPTET Paper 2 Maths & Science : PYP Held on 23rd Jan 2022 (Shift 2)

languageIcon English
  • pdpQsnIcon150 Questions
  • pdpsheetsIcon150 Marks
  • timerIcon150 Mins
languageIcon English
test-prime-package

Access ‘BPSC TRE (11-12)’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
353k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow