Lab: Implementing Stacks and Queues with Arrays

In today’s lab, you will complete the implementation of stack and queue data structures using arrays. Unlike our previous labs, this one does not have separate parts or exercises; you’ll need to complete the entire implementation, but it is up to you to decide what to do and in what order. The only requirement, other than standard good C coding practices, is that you use arrays to store the data held in your stack and queue.

Download a copy of the starter code archive stacks-queues-arrays.tar.gz and run the following commands to get started:

$ cd ~/csc161/labs
$ tar xvzf ~/Downloads/stacks-queues-arrays.tar.gz
$ cd stacks-queues-arrays
$ code .

The starter code for this lab is the same as the linked list version we used in our previous class. As before, you should only edit the struct definitions in the provided header files and function implementations in the .c file for each data structure. Do not edit the driver programs, and do not change the functions that make up the interface for the stack or the queue. You are welcome to add additional structs to the string_stack.h and string_queue.h header files if necessary.