A stack type should allow insertions and deletions such that the item deleted is the last one inserted - last in, first out.
We might also want to know if the stack is empty and if not, to be able to examine the last item inserted.
A stack type should allow insertions and deletions such that the item deleted is the last one inserted - last in, first out.
We might also want to know if the stack is empty and if not, to be able to examine the last item inserted.