Constructing Stacks and Queues

In everyday life, we use two of the most common data structures. We can assume that these data structures are inspired by the real-world, but they have very important effects in the computing world. We are talking about stack and queue data structures. We stack our books, files, plates, and clothes on a daily basis, whereas we maintain queues for ticket counters, bus stops, and shopping checkouts. Also, we have heard about message queue in PHP, one of the most used features in high-end applications. In this chapter, we are going to explore the different implementations of popular stack and queue data structures. We are going to learn about queues, priority queues, circular queues, and double-ended queues in ...

Get PHP 7 Data Structures and Algorithms 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.