Data Structure (2130702)

BE | Semester-3   Summer-2016 | 06/09/2016

Q3) (b)

Explain the concept of circular queue. Compare circular queue with simple queue.

A more suitable method of representing simple queue which prevents an excessive use of memory is to arrange the elements Q[1], Q[2]….,Q[n] in a circular fashion with Q[1] following Q[n], this is called circular queue.

In a standard queue data structure re-buffering problem occurs for each dequeue operation. To solve this problem by joining the front and rear ends of a queue to make the queue as a circular queue.
Circular queue is a linear data structure. It follows FIFO principle.
In circular queue the last node is connected back to the first node to make a circle.
Circular linked list fallow the First In First Out principle. Elements are added at the rear end and the elements are deleted at front end of the queue.
Both the front and the rear pointers points to the beginning of the array.
It is also called as “Ring buffer”.