Hashing lets us store and retrieve data in roughly constant time by computing where an item belongs instead of searching for it. But a hash function usually produces a value from a very large space — think of every possible string, every possible integer, every possible student ID — while the table we actually allocate has only a modest number of slots. Hash compression is the step that bridges that gap: it maps a large, unbounded set of hash codes or keys onto the bounded range of valid array indices, typically 0 through tableSize - 1.
This introductory topic sets up the vocabulary you will use for the rest of the module: key, hash code, compression function, index, bucket, collision, and load factor. It also frames the central tension you will return to repeatedly — compressing many keys into few slots guarantees that some keys will collide, so the goal is not to avoid collisions entirely but to spread keys as uniformly as possible while keeping the computation cheap.
As you watch the videos below, focus on three things. First, notice exactly where in the pipeline the key is converted into an index — that step is the compression we are naming. Second, pay attention to how table size enters the picture, since the size of the index range is a design choice with real consequences. Third, listen for how each presenter describes collisions, because that language will anchor the later subtopics on distribution uniformity and effective hash function properties.
A widely watched lecture-style introduction to hashing in data structures, working through the basic idea with a concrete example. Based on its title and description, it should cover what a hash function is, how keys are turned into table locations, and why hashing is used for fast lookup. Expect the classic worked example of inserting keys into a fixed-size table.
It is the most accessible entry point for the "What Is Hash Compression?" and "Core Vocabulary" subtopics, and the step-by-step example format makes the mapping from key to index visible rather than abstract.
A tightly edited four-minute overview of hash tables from a channel known for concise algorithm explanations, with accompanying code linked in the description. It is likely to cover the structure of a hash table, the role of the hash function in choosing a slot, and what happens when two keys land in the same place. The brevity means it focuses on the essential mechanics rather than extended examples.
Michael Sambol's videos are accurate and unusually compact, making this a good second pass that reinforces the key-to-index mapping and the inevitability of collisions in a bounded index range.
Khan Academy explains how a computer stores a dictionary in memory and, per its description, how hashing is used to convert keys into indices. Expect a gentle, well-illustrated walkthrough tied to a familiar Python data structure, showing the connection between an abstract key-value mapping and the underlying array.
It names the exact operation at the heart of this topic — converting keys to indices — and connects hash compression to a language feature students already use, which strengthens the motivation subtopic.
Together these videos build the conceptual foundation the module's outcomes depend on. All three establish the definition of hashing and the key-to-index mapping that MO1 asks you to articulate, and they introduce collisions and table slots as the vocabulary you will need. They also prepare you for MO2 by showing where a compression step like modular arithmetic plugs into the lookup pipeline, and for MO3 and MO4 by making clear that table size and key distribution are design decisions rather than fixed facts. The videos are introductory by design: they motivate and define the problem, while the specific compression techniques and trade-off analysis are developed in the later topics of this module.
These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.