
146 Introduction to Computational Modeling
Figure 10.7 illustrates the form of a stack. It shows the top of the stack as the
insertion point and the removal point. The operations that manipulate a stack ADT
are:
• create stack, create an empty stack.
• sEmpty, returns true if the stack is empty; otherwise returns false.
• sFull, returns true if the stack is full; otherwise returns false.
• top, returns a copy of the data block at the top of the stack without removing
the node from the stack.
• pop, removes the node from the top of the stack.
• push, inserts a new node to the top of the stack.
• stackSize, returns the number of nodes currently in the stack. ...