the stack adt stack is list with the restriction that insertions and deletions can be performed in only one positionnamelythe end of the listcalled the top stack model the fundamental operations on stack are pushwhich is equivalent to an insertand popwhich deletes the most recently inserted element the most recently inserted element can be examined prior to performing pop by use of the top routine pop or top on an empty stack is generally considered an error in the stack adt on the other handrunning out of space when performing push is an implementation limit but not an adt error stacks are sometimes known as lifo (last infirst outlists the model depicted in figure signifies only that pushes are input operations and pops and tops are output the usual operations to make empty stacks and test for emptiness are part of the repertoirebut essentially all that you can do to stack is push and pop figure shows an abstract stack after several operations the general model is that there is some element that is at the top of the stackand it is the only element that is visible pop stack push top figure stack modelinput to stack is by pushoutput is by pop and top top figure stack modelonly the top element is accessible