Write an algorithm of priority circular queue Insertion.

Priority Circular Queue Insertion:

  • In priority circular queue insertion first we check whether queue is empty. If the queue is empty we show “the queue is empty ” and return.
  • In second condition we check whether the queue is empty so we insert the value in first Index.
  • In 3rd condition if Rear is in last index so we shift the rear on next index because it,s a circular queue.
  • In next condition we check space is available in queue and we increment in Rear and insert the value using it,s priority.


P CQInsertion(Queue,N,F,R,Value,P)
(1) [Start]
(2) [Check For Full]
If F=0 AND R=N-1 OR R+1=F Then
Show “ Queue is Full”
Else If R= -1 Then’
Else If R= N -1 Then
[End Of If Else step 2]
Queue [P][R]=Value
(3) [Return]

Leave a Reply

Your email address will not be published. Required fields are marked *