Queues and stacks are both linear structures that restrict where you may insert and remove elements, but they restrict them in opposite ways. A queue follows FIFO (first in, first out): items enter at the rear and leave from the front, so the element that has waited longest is served first. A stack follows LIFO (last in, first out): items are pushed and popped at a single end, so the most recently added element is removed first. That single difference in the point of access is what drives everything else about how the two structures behave.
This comparison matters because in practice you rarely choose a structure by its name; you choose it by the ordering behavior a problem demands. Scheduling, buffering, breadth-first traversal, and any "serve in arrival order" situation point toward a queue. Undo histories, expression evaluation, backtracking, recursion and call stacks, and depth-first traversal point toward a stack. Being able to justify that choice is as important in this course as being able to code either structure.
As you watch the videos below, pay attention to three things: the vocabulary of the operations (push/pop versus enqueue/dequeue), where the pointers or indices live (top versus front and rear), and the real-world examples used to motivate each structure. The third video goes a step further and shows that the two structures are related closely enough that one can be simulated with the other — a useful way to confirm that you really understand what each ordering principle costs you.
An introductory lecture on the stack abstract data type, covering the LIFO ordering principle and the two core operations, PUSH and POP. Based on its title and description, it should walk through how the top pointer moves as elements are added and removed, and likely touches on overflow and underflow conditions. It is the stack half of the comparison you are building.
Gate Smashers lectures are widely used exam-prep material known for clear, step-by-step explanations, and this one gives you the precise stack terminology and single point of access you need to contrast against the queue.
An introduction to the queue data structure that, as the title indicates, motivates it with a real-life example. Expect coverage of the FIFO ordering principle, the front and rear ends, and the enqueue and dequeue operations that act on them. It pairs directly with the stack lecture from the same channel.
Using the same instructor and format as the stack video makes the side-by-side comparison of ordering principles, operations, and points of access very easy to see, and the real-life example supports the "when would I use this" subtopics.
A short, focused Geekific video on the classic problem of implementing a queue using two stacks, with visualization and code. It should show how pushing onto one stack and transferring to a second reverses the order, converting LIFO behavior into FIFO behavior, and discuss the cost of that transfer.
This is the best possible test of whether you truly understand the difference between the two orderings, and it reinforces the idea that ordering behavior — not the container — is what you are really selecting when you choose a structure.
Together these videos target the comparison outcomes of the module. The queue lecture reinforces the FIFO principle and the enqueue/dequeue operations that define it (MO1), while the stack lecture supplies the LIFO counterpart with its push/pop operations and single top-of-stack access point; watched together they give you the direct contrast in ordering principles, points of access, and typical use cases called for by MO4. The implement-a-queue-using-stacks video deepens that contrast by forcing you to reason about what it costs to convert one ordering into the other, which is exactly the kind of reasoning MO5 asks for when justifying a structure choice for a given problem. These videos support, but do not replace, the module's coverage of array-based and linked-list queue implementations and their complexity trade-offs (MO2, MO3).
These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.