A stack is a last-in, first-out (LIFO) data structure. They get their name from their similarity to how cafeterias provide plates to their customers. Cafeteria service personnel add hot, wet, clean plates to the top of a spring-loaded tube, pushing the cold, dry plates further down the tube. The next customer takes a plate from the top of the stack. The act of adding an item to a stack is called pushing. To remove an item is to pop it. Exercises in this section involves the use of stacks.

Available Exercises

Exercise 9.1. Write a program that uses an array to implement a stack.

Exercise 9.2. Write a program that uses a linked list to implement a stack.