Skip to content
Computer Science · 10th Grade

Active learning ideas

Dictionaries and Hash Tables

Active learning works for dictionaries and hash tables because these abstract concepts become concrete when students physically model operations. Students remember the frustration of linear searches or the clarity of instant lookups far better when they experience both sides of the comparison.

Common Core State StandardsCSTA: 3A-AP-14
25–50 minPairs → Whole Class3 activities

Activity 01

Simulation Game25 min · Whole Class

Simulation Game: The Human Join

Half the class holds cards representing a 'Students' table, and the other half holds an 'Enrollment' table. Students must find their 'match' based on a shared ID key to demonstrate how a SQL JOIN operation combines data from different sources.

Explain the underlying mechanism of a hash table.

Facilitation TipDuring the Human Join simulation, arrange desks in two intersecting circles so students literally see how primary and foreign keys connect tables.

What to look forPresent students with a list of items (e.g., student names and IDs) and ask them to explain how a dictionary/hash table would store this data more efficiently than a simple list for lookups. Prompt them to identify a potential hash function and discuss what happens if two students have the same ID.

ApplyAnalyzeEvaluateCreateSocial AwarenessDecision-Making
Generate Complete Lesson

Activity 02

Inquiry Circle45 min · Small Groups

Inquiry Circle: Normalization Challenge

Groups are given a messy, redundant spreadsheet of music festival data. They must work together to 'normalize' it by breaking it into three logical tables (Artists, Stages, Schedule) and defining the primary and foreign keys that link them.

Compare the efficiency of dictionaries to lists for data lookup.

Facilitation TipFor the Normalization Challenge, provide unnormalized sample data on sticky notes so students physically rearrange rows and columns.

What to look forAsk students to write down one advantage of using a dictionary over a list for searching data and one challenge associated with hash tables. They should also define 'hash collision' in their own words.

AnalyzeEvaluateCreateSelf-ManagementSelf-Awareness
Generate Complete Lesson

Activity 03

Mock Trial50 min · Whole Class

Mock Trial: The Data Privacy Breach

Students role-play a scenario where a company accidentally leaked sensitive information by improperly linking two databases. They must argue whether the company followed best practices for data integrity and privacy or if they were negligent in their database design.

Analyze the impact of hash collisions on dictionary performance.

Facilitation TipIn the Data Privacy Breach mock trial, assign roles clearly so students focus on the data implications rather than debating guilt or innocence.

What to look forFacilitate a class discussion: 'Imagine you are building a system to store and quickly retrieve definitions for 10,000 programming terms. Would you use a list or a hash table? Justify your choice, considering potential issues like similar terms or common prefixes.'

AnalyzeEvaluateCreateDecision-MakingSocial Awareness
Generate Complete Lesson

A few notes on teaching this unit

Experienced teachers approach this topic by alternating between physical models and digital tools, never letting either dominate. They explicitly contrast spreadsheets with databases to highlight purpose, and they use analogies students already know—like phone contacts or library card catalogs—before introducing formal terms. Avoid diving straight into SQL syntax; let students first feel the pain of unnormalized data before offering solutions.

Successful learning looks like students confidently explaining when a hash table is superior to a list, identifying hash collisions in real data, and justifying their choice of data structure for specific tasks. They should articulate why normalization reduces redundancy and how joins connect tables without losing information.


Watch Out for These Misconceptions

  • During Simulation: The Human Join, watch for students who treat the activity as a simple matching game rather than a demonstration of relational integrity.

    Pause the simulation midway and ask each student to explain which table they represent and how their data changes if a related record is deleted, reinforcing the concept of referential integrity.

  • During Collaborative Investigation: Normalization Challenge, watch for students who think normalization means making tables smaller rather than eliminating redundancy.

    Have students count the number of times a single customer’s address appears in their unnormalized data and then compare it to the normalized version, making the cost of redundancy explicit.


Methods used in this brief