Operator stack_destroy (Stack s) -> Stack
Pre
s is a valid stack
Post
the resources allocated to s are freed
returns NULL
End
for the push and pop functions we have the following:
Operator stack_push (Stack s, int item)
Pre
s is a valid stack
s isn't full
Post
the stack increases in size by 1
item is the new top element of s
End
Operator stack_pop (Stack s) -> int
Pre
s is a valid stack
s isn't empty
Post
the returned value is the top element
of the stack
the top element of the stack is removed
End
The remaining three functions are specified in the
following way
|