Assuming that the Circular queue is stored in as array QU with size N.
This algorithm will delete an element from the circular queue and assign it to D-ITEM.
[Checking if QU is already empty or not?]
1. if FRONT = NULL then
{
write "Underflow !!"
return
}
else
{
2. set D_ITEM = QU [FRONT]
[Now Making FRONT point to the next element in the queue]
3. if FRONT = REAR then
{
FRONT = NULL
REAR = NULL
}
4. else if FRONT = N then
FRONT = 1
else
5. FRONT = FRONT + 1
6. return
Read Also:- Algorithm to insert an element in a circular queue
This is the Algorithm to Delete an Element from a Circular Queue. If you have any questions then comment below.