CS230 Final Exam

http://nordlie.cs.und.edu/cs230/230_final/

For this exam, you will take a program, which implements a queue using a singly-linked list, and modify it to implement a stack. To do this, you will need to rename the functions "enqueue" and "dequeue" to "push" and "pop", and change their functionality such that they will work on a single end of the linked list (stack) instead of both ends (queue). Big Hint: having the code only work on the head end of the list will make your life easier. You will also need to modify the section of the main function which parses the commands from the input file.

The original program ingested commands and data from a text file called "queue_input.list". The output of the program is shown here.

The new program should ingest commands and data from a text file called "stack_input.list". The output of the new program should look like this.

When you are done, raise your hand so I can come and see your code and output. I will check you off when you are done. If you cannot get the code to work perfectly, keep at it, and I will grade you on what you have done at the end of the testing period.