We have learned how stacks work. Queues are a very similar data structure, but instead of LIFO, they use a different principle that we will learn about in this chapter. We will also learn how deques, a data structure that mixes the stack and queue principles, work.
In this chapter, we will cover the following topics:
- The queue data structure
- The deque data structure
- Adding elements to a queue and a deque
- Removing elements from a queue and a deque
- Simulating circular queues with the Hot Potato game
- Checking whether a phrase is a palindrome with a deque