CS170

Programming Assignment #1

DUE : Thursday 2/6, 11:00pm.


Implement a stack abstract data type in C. Your stack should be capable of holding integer values. Hide the implementation of the stack from the client via the incomplete type facility of ANSI C. The implementation of the stack must be as a linked list. Be sure that the stack functions allocate and deallocate memory appropriately. As a model, use the queue ADT and implementation discussed in lecture.
The queue ADT as discussed in lecture can be downloaded in the following files:

Your program MUST follow these specifications:


Be sure to document your code carefully and appropriately.

You can test your program with this file. Add it to the folder in which you build the project, and at the Linux prompt, just type ./exec < input1.txt. The output should be this.

Create a .zip of a folder named StackProject containing the files Stack.h, Stack.c, main.c, and Makefile.
Submit it at this location.

Back to CS170 Assignments.