Lecture Outline
- Adding and removing elements from a stack or queue only takes O(1) time
- A priority queue is queue which removes items based off of "priority" rather than FIFO
- A double-ended queue (deque) is a queue in which items can be added/removed from either end
- When we need to use a Stack data structure, we can import java.util.Stack;
- When we need to use a Queue data structure, we can import java.util.LinkedList, or java.util.PriorityQueue
Lecture Recording
Lecture Slides
Code