Activity 01
Pair Programming: Simple Hash Table
Pairs code a hash table in Python using a list of lists for chaining. They define a hash function with modulo, insert 15-20 keys like student IDs, handle collisions by appending to lists, and test retrieval. Pairs then swap codes to debug and compare load factors.
Explain how a hash function maps data to an index in a hash table.
Facilitation TipDuring Pair Programming: Simple Hash Table, ask pairs to swap roles between coding and recording observations so both partners engage with the algorithm and its behavior.
What to look forPresent students with a small dataset and a simple hash function (e.g., modulo division). Ask them to manually calculate the hash index for each item and identify any collisions. Then, ask them to explain how chaining would handle one specific collision.