1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

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

*

*

March 1, 1999

Page 11

C201/TAM