Google News
logo
Data Structures - Quiz(MCQ)
Which of the following that determines the need for the Circular Queue?
A)
Follows the FIFO principle
B)
Avoid wastage of memory
C)
Access the Queue using priority
D)
None of the above

Correct Answer :   Avoid wastage of memory


Explanation : Avoid wastage of memory. In a linear queue, there are chances of wastage of memory because if the rear is pointing to the last element whereas the front is pointing to the element other than the first element; it means that spaces allocated before the front are free, but it cannot be reused as rear cannot be incremented. In contrast, the last element is connected to the first element in a circular queue; if initial spaces are vacant, then rear can be incremented by using the statement (rear+1) mod max where max is the size of the array. Therefore, we conclude that the circular queue avoids wastage of memory.

Advertisement