Stacks and Queues
Overview
Peanut butter and jelly, Batman and Robin, Rick and Morty... stacks and queues are another iconic duo.
There are two components to this lesson:
- myGA module: Stacks and Queues
- If the above link does not take you to the correct module, you can find the lesson in your myGA dashboard.
- In-Class Exercise: Bracket Matching
Learning Objectives
By the end of this lesson, you'll be able to:
- Distinguish between a stack and a queue.
- Determine situations in which you’d use a stack or queue over another data structure.
- Build a stack and a queue using a linked list or an array.
Prerequisites
- Big O notation
Duration
1.5 hours total:
- 0.5 hour myGA
- 1 hour in class
Additional Resources
- Here are visualizations for the two implementations of stacks: the array implementation and linked list implementation.
- Same thing for queues: the array implementation and linked list implementation.
- Common interview questions about stacks and queues.
- Don’t forget to review priority queues and deques.