Circular Queue Data Structure
Circular Queue Data Structure
A circular queue is the extended version of a regular queue where the last
element is connected to the first element. Thus forming a circle-like
structure.
2. Dequeue Operation
The second case happens when REAR starts from 0 due to circular
increment and when its value is just 1 less than FRONT , the queue is full.
Operations
Memory management
Traffic Management
Representation of Deque
Types of Deque
Input Restricted Deque
In this deque, input is restricted at a single end but allows deletion at both
the ends.
Output Restricted Deque
In this deque, output is restricted at a single end but allows insertion at both
the ends.
Operations on a Deque
Below is the circular array implementation of deque. In a circular array, if the
array is full, we start from the beginning.
But in a linear array implementation, if the array is full, no more elements
can be inserted. In each of the operations below, if the array is full,
"overflow message" is thrown.
.
1. Check if the deque is empty. Check if deque is empty
1 and rear = -1 .
4. Else if front is at the end (i.e. front = n - 1 ), set go to the front front = 0 .