Skip to content
Computer Science · 10th Grade

Active learning ideas

Stacks and Queues: LIFO & FIFO

Active learning works because stacks and queues are intuitive in physical form yet abstract in concept. When students physically act out LIFO and FIFO, the rules stick in ways a lecture never could. The mismatch between how we naturally think and how these structures behave creates memorable cognitive dissonance that leads to deeper understanding.

Common Core State StandardsCSTA: 3A-AP-14
20–45 minPairs → Whole Class4 activities

Activity 01

Simulation Game25 min · Whole Class

Simulation Game: Human Stack and Queue

Use two groups of students as physical stacks and queues. The teacher calls out operations (push, pop, enqueue, dequeue) while students physically move in or out of a line. After the simulation, students sketch the state of both structures at several checkpoints and explain what invariant each structure maintains.

Differentiate between the LIFO and FIFO principles.

Facilitation TipDuring the Human Stack and Queue simulation, clearly mark the front and back of the line with tape or signs to avoid ambiguity in direction.

What to look forProvide students with two scenarios: 1) A list of tasks to be completed in the order they arrive. 2) A web browser's back button functionality. Ask students to identify which scenario best represents a stack and which represents a queue, and to briefly explain their reasoning for each.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 02

Think-Pair-Share20 min · Pairs

Think-Pair-Share: Spot the Structure

Give pairs a list of 10 real-world systems (browser back button, print queue, function call log, ticket line, undo history). Each pair classifies each system as stack-based, queue-based, or neither, and writes one sentence justifying each choice. Pairs then compare with another pair and resolve disagreements as a group of four.

Analyze real-world applications where stacks are essential.

Facilitation TipFor Think-Pair-Share, provide a timer so pairs have 2 minutes to discuss before sharing with the class to keep energy high.

What to look forPresent students with a sequence of operations for both a stack and a queue, for example: Stack: push(A), push(B), pop(), push(C). Queue: enqueue(X), enqueue(Y), dequeue(), enqueue(Z). Ask students to write down the state of the stack and queue after all operations are completed, verifying their understanding of push/pop and enqueue/dequeue.

UnderstandApplyAnalyzeSelf-AwarenessRelationship Skills
Generate Complete Lesson

Activity 03

Role Play45 min · Small Groups

Collaborative Coding: Task Manager Queue

Small groups implement a simple task scheduler using a queue data structure. They are given a starter file with incomplete enqueue and dequeue methods, a list of test tasks, and instructions to process tasks in arrival order. Groups compare their output logs and troubleshoot any ordering errors together.

Construct a simple program utilizing a queue for task management.

Facilitation TipIn the Collaborative Coding activity, assign specific roles like Task Manager and Queue Monitor to ensure every student participates.

What to look forFacilitate a class discussion using the prompt: 'Imagine you are designing a system for managing customer support tickets. Would you use a stack or a queue? Justify your choice by explaining how the LIFO or FIFO principle applies to efficient customer service.' Encourage students to debate the merits of each approach.

ApplyAnalyzeEvaluateSocial AwarenessSelf-Awareness
Generate Complete Lesson

Activity 04

Gallery Walk40 min · Small Groups

Gallery Walk: Stack Applications Posters

Each group creates a poster for a different stack application (recursion call stack, browser history, expression parsing, undo system), explaining how LIFO behavior makes that application function correctly. Groups rotate and add one insight and one question to each poster before a class debrief.

Differentiate between the LIFO and FIFO principles.

Facilitation TipDuring the Gallery Walk, ask students to add sticky notes with questions to each poster to spark peer discussion.

What to look forProvide students with two scenarios: 1) A list of tasks to be completed in the order they arrive. 2) A web browser's back button functionality. Ask students to identify which scenario best represents a stack and which represents a queue, and to briefly explain their reasoning for each.

UnderstandApplyAnalyzeCreateRelationship SkillsSocial Awareness
Generate Complete Lesson

A few notes on teaching this unit

Start with physical simulations because bodies in motion make abstract rules visible. Avoid introducing code too early; let students internalize behavior first. Use real-world analogs they already know, like call stacks in everyday apps, but link them explicitly to the structures. Research shows that students grasp these concepts faster when they see the same pattern in multiple contexts, so rotate examples across activities.

Students will confidently distinguish stacks from queues by their access rules and explain real-world uses with examples. They will trace operations step-by-step without confusion between push/pop and enqueue/dequeue. Misconceptions about storage details will fade as they focus on behavior instead of implementation.


Watch Out for These Misconceptions

  • During the Simulation activity, watch for students who confuse the terms 'first' and 'last' by pointing to the wrong end of the line.

    Pause the simulation when confusion arises and ask students to physically push an object onto their stack or step into the queue, then verbally state who is first and who is last before continuing.

  • During the Think-Pair-Share activity, listen for students who claim stacks and queues are just different types of lists because they look similar in code.

    Use the posters from the Gallery Walk to point out that the difference is in the access rules, not the storage, and ask students to trace a sequence of operations on each structure to see the behavior difference.


Methods used in this brief