Stacks
Learn C++ in step-by-step lessons.
Stacks
A stack is a list where all of the operations occur at the top. We can push (add to the from of the list), pop (return and remove the item at the top of the stack), and test for empty. A stack can be described as LIFO: last in, first out.
Goals:
- Name and describe some of the most common uses for a stack
Objectives:
- Be able to implement a stack using an array
- Explain the difference between pushing an popping
Please study the material at each of the links below.
- Implementing stack with an array
- Experiment with pushing and popping: Demo lets you push and pop from a stack.
Glossary for stacks lessonFull Glossary