Use the previous written C program to develop stacks and queues
Lab 6
Goals
The primary goal of this project is to use linked lists to build stack and queue data structures. This
lab is the second of 2 parts. The rst part, Lab 5, involved the construction of the single linked
list with all of its structure and functions. The second part is the use of the linked list to construct
stacks and queues. The stacks and queues will then be used to manipulate data.
Stack
Develop a stack data structure, using a linked list, with the following functions:
Push - pushes a data node onto the top of the stack. This function will need a parameter of
the data type stored in the stack.
Pop - Takes the top node o the stack and returns the data to the program.
Size - returns the size of the stack in terms of the number of nodes.
Empty - returns a boolean, true if the stack has no nodes and false if the stack has greater
than 0 nodes.
Queue
Develop a queue data structure using a linked list, with the following functions:
Enqueue - adds a data node onto the back of the queue. This function will need a parameter
of the data type stored in the queue.
Dequeue - Takes the front node from the queue and returns the data to the program.
Size - returns the size of the queue in terms of the number of nodes.
Empty - returns a boolean, true if the queue has no nodes and false if the queue has greater
than 0 nodes.
The description for each of the stack and queue functions were given in class. There must be a
Node Struct containing data and a pointer. In this case, the data will be a Struct with the following
data: First Name, Last Name, PUID and Age. You will need a start pointer to maintain the head
of the list and a current pointer when traversing the list. Hint - think about the order to write the
functions, as some are dependent on others!
To use the stack and queue, you will develop a simple text-based interface. The interface will
ask a user to input data for a Struct First Name, Last Name, PUID, Age. Once you get the 4 data
12 years ago
Purchase the answer to view it

- linkedlist_queue_c.c
- linkedlist_stack_c.c