Data Structures · Question 18 · Easy
A data structure allows insertion and deletion at both the front and the rear end, but not in the middle. What is it called?
- Stack
- Deque (double-ended queue)
- Priority queue
- Circular queue
Answer and explanation
Answer: B. Deque (double-ended queue)
Explanation: A deque (double-ended queue) supports push and pop at both ends. A circular queue still inserts only at the rear and deletes only at the front.
Previous: What is the time complexity of inserting a new node at the beginning (head) of… · Next: A tree data structure has 25 nodes. How many edges does it have?
Practise data structures
Try a fresh set of data structures questions with an explanation after every answer, free and without signing up: Data Structures practice. Or sit a full placement mock test.
More data structures questions
- Two stacks share a single array arr[0..n-1]. Stack 1 starts at index 0 and…
- Which data structure is the most natural choice for implementing the Undo…
- What is the time complexity of inserting a new node at the beginning (head) of…
- A tree data structure has 25 nodes. How many edges does it have?
- Which of the following is a non-linear data structure?
- The keys 45, 20, 60, 10, 30, 25, 50 are inserted in that order into an empty…
- What is the prefix (Polish) form of the infix expression (A + B) * (C - D) ?
- The keys 12, 22, 35, 42, 55, 7, 17 are inserted into a hash table of size 10…
- An undirected simple graph has 6 vertices whose degrees are 3, 3, 2, 2, 2 and…
- In a doubly linked list, you are given a pointer to a node (not the head or…
More technical & programming practice
Algorithms · Object-Oriented Programming · DBMS · SQL · Operating Systems · Computer Networks · Software Engineering · Cloud & DevOps
LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge