An Introduction to Stacks
With Examples in C++ |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
Values: | Homogeneous elements of any type. | ||||||||||||||||||
Operations: |
|
In addition,
if the stack has a "size limit", one could add an
isFull()
operation; some people add a
peek()
operation; and some people add a
makeEmpty()
operation.
1 | . | . |
1 | 2 | . |
pop()
to make it
return a bool
indicating the status
but still have it "return" the top item?
const
?