Thursday, 18 July 2013

Algorithm for Insertion a Element in Queue

  1. If Front==1&&Rear==Max or Front=Rear+1Then print Overflow and Exit
  2. If Front=NullThen Set Front=Rear=1Else If Rear=Max thenSet Rear=1ElseRear=Rear+1
  3. Queue[Rear]=item
  4. Exit

No comments:

Post a Comment