Now that we know how to use the Queue and Deque classes, let's use them to solve some computer science problems. In this section, we will cover a simulation of the Hot Potato game with queues and also how to check whether a phrase is a palindrome with deques.
Solving problems using queues and deques
Get Learning JavaScript Data Structures and Algorithms - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.