In a circular queue implementation using array of size 5, the array index starts with 0 where front and rear values are 3 and 4 respectively. Determine the array index at which the insertion of the next element will take place.

A)  5
B)  2
C)  1
D)  0

Correct Answer :   0


Explanation : 0. As it is mentioned in the question that the size of the array is 5; therefore, the range would be from 0 to 4. In a circular queue, the last element is connected to the first element; the value of rear is 4 so when we increment the value then it will point to the 0th position of the array.