Thursday, 18 July 2013

Algorithm for Pushing an Element into Stack

PUSH(s,MAXSTK,TOP,item)
  1. If TOP=MAXSTK thenPrint Overflow and Return
  2. TOP=TOP+1
  3. S[TOP]=item
  4. Exit

No comments:

Post a Comment