MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Let the following circular queue can accommodate maximum six elements with the following datafront = 2 rear = 4queue = ____ ; L, M, N, ____, ____ What will happen after ADD O operation takes place?
A
front = 2 rear = 5queue = ____ ; L, M, N, O, ____
B
front = 3 rear = 5queue = L, M, N, O, ____
C
front = 3 rear = 4queue = ____ ; L, M, N, O, ____
D
front = 2 rear = 4queue = L, M, N, O, ____
Explanation: 

Detailed explanation-1: -Explanation: Queue follows First In First Out structure. 2. In a circular queue, how do you increment the rear end of the queue? Explanation: Ensures rear takes the values from 0 to (CAPACITY-1).

Detailed explanation-2: -When we insert the first element in a Queue, front and rear both are set to 0. When we insert a new element, the rear gets incremented, i.e., rear=rear+1.

Detailed explanation-3: -2. Input restricted Queue: In this type of Queue, the input can be taken from one side only(rear) and deletion of elements can be done from both sides(front and rear). This kind of Queue does not follow FIFO(first in first out).

Detailed explanation-4: -Which of the following data structures allows you to insert the elements from both the ends while deleting from only one end? Explanation: The answer is b. The output-restricted queue is one of the types of the Deque data structure in which insertion is allowed from both ends but deletion is allowed from only one end.

There is 1 question to complete.