Skip to content
Computer Science · Grade 11

Active learning ideas

Dynamic Lists and Memory

Active learning helps students grasp the trade-offs between arrays and linked lists by making abstract concepts tangible. When students manipulate physical models or analyze code outputs, they connect theory to observable behavior, which builds deeper understanding than passive reading or lecture alone.

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

Activity 01

Gallery Walk35 min · Small Groups

Physical Model: Array vs Linked List Operations

Provide index cards as data elements and string as pointers. In small groups, students build an array by placing cards in a row and insert an element in the middle, noting shifts needed. Then reconstruct as a linked list, inserting by linking nodes, and compare effort and steps recorded on worksheets.

How does the way data is stored in memory affect the speed of accessing it?

Facilitation TipDuring the Physical Model activity, have students physically move index cards to simulate array shifts and pointer redirections, so timing differences become visible.

What to look forPresent students with two scenarios: Scenario A involves frequent additions/removals at the beginning of a collection, and Scenario B involves frequent random access to elements. Ask students to identify which data structure, array or linked list, would be more efficient for each scenario and to briefly justify their choice.

UnderstandApplyAnalyzeCreateRelationship SkillsSocial Awareness
Generate Complete Lesson

Activity 02

Gallery Walk45 min · Pairs

Coding Duel: Implement and Test

Pairs code a dynamic array (using vectors) and singly linked list class in Python or Java. Add methods for insert, delete, and search, then run tests on datasets of 100 items, timing each operation with code timers and charting results for discussion.

Why would a developer choose a linked list over a dynamic array?

Facilitation TipIn the Coding Duel, assign one student to implement an array version and another a linked list version of the same function, then run both on the same data to directly compare outputs.

What to look forFacilitate a class discussion using the prompt: 'Imagine you are building a music player application. Would you use an array or a linked list to store the playlist? Explain your reasoning, considering how users add, remove, and reorder songs.'

UnderstandApplyAnalyzeCreateRelationship SkillsSocial Awareness
Generate Complete Lesson

Activity 03

Gallery Walk25 min · Individual

Memory Diagram Challenge

Individually, students draw memory blocks on grid paper to represent array allocation and resizing, then linked list nodes with pointers. Groups share diagrams, simulate a deletion, and calculate wasted space or traversal steps to identify patterns.

What are the implications of manual versus automatic memory management?

Facilitation TipFor the Memory Diagram Challenge, provide colored markers and grid paper so students can visualize pointer overhead and contiguous blocks side-by-side.

What to look forProvide students with a short code snippet that declares either an array or a linked list. Ask them to write down one advantage and one disadvantage of the chosen data structure in terms of memory usage or performance for common operations.

UnderstandApplyAnalyzeCreateRelationship SkillsSocial Awareness
Generate Complete Lesson

Activity 04

Gallery Walk40 min · Whole Class

Benchmark Race: Large Data Sets

Whole class competes: provide starter code for array and list. Students input 1000 elements, time 100 random insertions, and submit results to a shared sheet. Discuss winners per operation and graph class data to visualize trade-offs.

How does the way data is stored in memory affect the speed of accessing it?

Facilitation TipDuring the Benchmark Race, pre-load datasets of increasing size so students see how resizing and traversal times diverge with each operation.

What to look forPresent students with two scenarios: Scenario A involves frequent additions/removals at the beginning of a collection, and Scenario B involves frequent random access to elements. Ask students to identify which data structure, array or linked list, would be more efficient for each scenario and to briefly justify their choice.

UnderstandApplyAnalyzeCreateRelationship SkillsSocial Awareness
Generate Complete Lesson

A few notes on teaching this unit

Start with physical models to make memory and pointers concrete before coding. Avoid rushing into abstract explanations, as students often confuse time complexity with actual wall-clock time. Research shows that pairing simulations with code implementations helps students internalize trade-offs, so alternate between hands-on modeling and coding to reinforce concepts.

Students will confidently compare arrays and linked lists by identifying performance impacts of operations, explaining memory trade-offs, and justifying structure choices in real-world contexts. Success looks like clear explanations paired with correct code implementations and measured timings.


Watch Out for These Misconceptions

  • During the Physical Model: Array vs Linked List Operations, watch for students assuming arrays always outperform linked lists in all operations.

    After timing insertions at the beginning of each structure, ask students to compare the number of physical steps required for each operation and record the time differences to highlight the trade-off.

  • During the Memory Diagram Challenge, watch for students ignoring pointer overhead in linked lists.

    Have students count the number of memory blocks allocated per element in both structures, then discuss why linked lists use roughly twice as much space for the same data.

  • During the Benchmark Race: Large Data Sets, watch for students assuming dynamic arrays resize instantly without performance cost.

    After running multiple resize events, have students log the cumulative time taken and relate it to the O(n) copying process during resizing.


Methods used in this brief