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

*

this gives us the following set of functions:

stack_create stack_push stack_empty stack_peek

stack_destroy stack_pop
stack_full

*

note that all of these functions have been prefixed by "stack". This prevents the names from clashing with any other function names in our program

these functions will need some parameters, and possibly return values. The Stack type is used to represent a stack,all the other parameters will be integers

at the same time we will add pre- and post-conditions to our functions

for create and destroy we have the following:

Operator stack_create (int size) -> Stack
Pre
size > 0
Post
returns a new stack that can contain
size items
End

*

*

*

March 1, 1999

Page 10

C201/TAM