A stack is implemented as an array Stack of size N. TOS points to the current top of the stack . The initial value of TOS is -1. The code for push operation for a value in stack is given. fill EMPTY BOX 1 and EMPTY BOX 2
if( EMPTY BOX 1)
Stack[EMPTY BOX 2] = value;