Skip to content
Computer Science · Grade 11

Active learning ideas

Stacks, Queues, and Applications

Hands-on manipulation of stacks and queues helps students see how these abstract structures function in real systems. Physical and collaborative tasks make invisible processes visible, reducing confusion about priority and order. Students remember these concepts better when they experience the LIFO and FIFO rules through movement and discussion rather than abstract explanations alone.

Ontario Curriculum ExpectationsCS.HS.A.3CS.HS.A.4
20–45 minPairs → Whole Class4 activities

Activity 01

Stations Rotation45 min · Small Groups

Stations Rotation: LIFO and FIFO Stations

Prepare four stations: stack push/pop with cups, queue enqueue/dequeue with cards, priority queue sorting by number, and application demo with undo buttons. Groups rotate every 10 minutes, sketching operations and noting real-world links. Debrief as a class.

How do LIFO and FIFO structures mirror real-world organizational systems?

Facilitation TipDuring LIFO and FIFO Stations, circulate with a timer to keep rotations tight and ensure students physically act out each operation before discussing.

What to look forProvide students with two scenarios: one describing a web browser's back button functionality, and another describing a line at a movie ticket counter. Ask students to identify which data structure (stack or queue) best models each scenario and explain their reasoning in one sentence per scenario.

RememberUnderstandApplyAnalyzeSelf-ManagementRelationship Skills
Generate Complete Lesson

Activity 02

Pair Programming: Stack Expression Evaluator

Pairs code a stack-based program to convert infix math expressions to postfix, then evaluate them. Start with templates for push/pop methods. Test with expressions like (3+4)*2, discuss errors.

In what scenarios would a priority queue be more effective than a standard queue?

Facilitation TipBefore coding the Stack Expression Evaluator, have students trace one full expression on paper to identify where pushes and pops occur.

What to look forPresent students with a small, unsorted list of tasks, each with a priority level (e.g., 'High', 'Medium', 'Low'). Ask them to arrange these tasks as they would appear in a priority queue, explaining why a standard queue would be less effective for this specific set of tasks.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 03

Collaborative Problem-Solving35 min · Whole Class

Whole Class: Print Queue Simulator

Distribute task cards with priorities; class acts as queue, processing FIFO then priority order. Time each run, chart differences. Code a simple queue manager afterward.

How can we use a stack to evaluate mathematical expressions programmatically?

Facilitation TipIn the Print Queue Simulator, assign printed ‘jobs’ with timestamps so students see how order affects waiting times in real time.

What to look forFacilitate a class discussion using the prompt: 'Imagine you are designing a system for managing customer support tickets. When would a simple queue be sufficient, and when would you need to implement a priority queue? Provide at least two distinct examples for each case.'

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

Activity 04

Collaborative Problem-Solving20 min · Individual

Individual: Real-World Mapping

Students list 5 personal examples of stacks/queues, sketch diagrams, code one in pseudocode. Share one via gallery walk.

How do LIFO and FIFO structures mirror real-world organizational systems?

What to look forProvide students with two scenarios: one describing a web browser's back button functionality, and another describing a line at a movie ticket counter. Ask students to identify which data structure (stack or queue) best models each scenario and explain their reasoning in one sentence per scenario.

ApplyAnalyzeEvaluateCreateRelationship SkillsDecision-MakingSelf-Management
Generate Complete Lesson

A few notes on teaching this unit

Teach stacks and queues by starting with concrete, relatable examples before introducing formal definitions. Use analogies students already understand, like stacking plates or waiting in line, and then connect these to code. Avoid overwhelming students with terminology early; focus on the behavior first. Research shows that students grasp abstract concepts more easily when they can manipulate physical or visual representations, so prioritize activities that require action over passive note-taking.

Students will confidently distinguish between stacks and queues, explain their roles in common applications, and justify choices between standard and priority queues. They will also demonstrate how these structures solve problems by creating or simulating them in different contexts. Clear explanations during peer discussions and activity outputs will show mastery of these concepts.


Watch Out for These Misconceptions

  • During LIFO and FIFO Stations, watch for students who assume stacks and queues work the same way because they both store data.

    Ask them to physically demonstrate removal: one group should remove from the top of a stack, another from the front of a queue, then compare outcomes using the same set of numbered objects.

  • During the Print Queue Simulator, watch for students who believe priority queues ignore all order, including arrival time.

    Have them sort numbered task cards by priority and then by arrival time, then discuss why ties need a secondary rule.

  • During the Real-World Mapping activity, watch for students who only associate stacks with undo features in editors.

    Ask them to brainstorm other contexts where order matters, like browser history or function calls, and sketch how stacks apply in those cases.


Methods used in this brief