Sunday, September 15, 2013

Enque Algorithm for Curcular Queue using Array

If(Rear == U)
      next = L
Else
      next = Rear + 1
EndIf

If(next == Front)
      print “Queue is Full.

     Enqueue not possible.”
Else    
     If(Front < L) AND (Rear < L)
          Front = Front + 1
          Rear = Rear + 1    
     Else
          Rear = next
     EndIf
    
     A[Rear] = Item

No comments:

Post a Comment