Implementation of Stack using Array

Algorithm for PUSH operation on the stack

Algorithm fnPush(arrSTACK[], Data)
{
 if(fnFull()==TRUE)
 else
 {
 top=top+1;
 arrSTACK[top]=Data;
 }
}  // End of Algorithm

Algorithm for POP operation from the stack

Algorithm fnPOP(arrSTACK[])
{
 if(fnEmpty()==TRUE)
 stack is empty; 
 else
 {
 Data=arrSTACK[top];
 top=top-1;
 return Data;
 }
}  // End of Algorithm