|
|
|
|
Operator stack_full (Stack s) -> int
Pre
s is a valid stack
Post
returns True if s is full, otherwise
returns False
End
Operator stack_empty (Stack s) -> int
Pre
s is a valid stack
Post
returns True if there are no elements
in s, otherwise False
End
Operator stack_peek (Stack s) -> int
Pre
s is a valid stack
Post
returns top element of s,
s is left unchanged
End
Now that we have the specification, we can turn our
attention to the implementation
First we need to define the Stack type, and declare the
stack module functions, this will be done in the stack.h
include file
|
|