MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which data structure allows deleting data elements from and inserting at rear?
A
Stacks
B
Queues
C
Dequeues
D
Binary search tree
Explanation: 

Detailed explanation-1: -A Queue is an abstract linear data structure serving as a collection of elements that are inserted (enqueue operation) and removed (dequeue operation) according to the First in First Out (FIFO) approach. Insertion happens at the rear end of the queue whereas deletion happens at the front end of the queue.

Detailed explanation-2: -Insertion and deletion in stacks takes place only from one end of the list called the top. Insertion and deletion in queues takes place from the opposite ends of the list. The insertion takes place at the rear of the list and the deletion takes place from the front of the list.

Detailed explanation-3: -Double ended Queue: Double Ended Queue is also a Queue data structure in which the insertion and deletion operations are performed at both the ends (front and rear). That means, we can insert at both front and rear positions and can delete from both front and rear positions.

Detailed explanation-4: -A dequeue in data structure is a linear data structure that does not follow the FIFO rule (First in first out), that is, in a dequeue data structure, the data can be inserted and deleted from both front and rear ends.

There is 1 question to complete.