The queue from the last lesson is the plain kind. You'll meet four kinds in total. They differ in two things: where items may join and leave, and who gets served next.
Join at the back, leave from the front, first in, first out — exactly the queue from the last lesson. It's the one you want for fairness and order: print jobs, requests to a server, messages between programs, and the frontier of a breadth-first search.
Free account
Sign up to read the rest of this lesson: 5 more sections, 3 drawings, a dry-run simulator and code in JavaScript, Python, Java and C++.
Still to come