Collision Resolution: Open Addressing

Introduction

When two keys hash to the same index, a hash table needs a plan. Open addressing is one such plan: instead of storing colliding items in a separate structure like a linked list, every element lives directly in the table array, and a collision sends the insertion routine looking for another empty slot according to a fixed, repeatable rule. That rule is called the probe sequence, and the three classic versions you will meet here are linear probing (try the next slot, then the next), quadratic probing (step away by growing squared offsets), and double hashing (let a second hash function determine the step size).

This matters in COP3530 because open addressing is the main alternative to separate chaining, and the comparison is a recurring exam and interview topic. Open addressing avoids pointer overhead and keeps data contiguous in memory, but it imposes constraints chaining does not: the load factor can never exceed 1, performance degrades sharply as the table fills, and deletion cannot simply blank out a slot without breaking the probe sequences that pass through it — hence tombstone or lazy-deletion markers.

As you watch the videos below, keep a pencil handy and build the table yourself alongside the instructor. Watch specifically for three things: the exact formula used to compute each successive probe, how the search operation must follow the same sequence that insertion used, and where clustering appears — primary clustering in linear probing, secondary clustering in quadratic probing — and how each later technique tries to reduce it.

Video 1: L-6.4: Linear Probing in Hashing with example

Gate Smashers · 12:40 · 945,731 views · 5y ago · captions — Watch on YouTube

About this video

A worked introduction to linear probing, the simplest open addressing scheme, in which a collision causes the table to be scanned sequentially until an empty slot is found. Based on the title and description, the video walks through a concrete numeric example of inserting keys into a table and resolving collisions step by step. Expect discussion of how searching must follow the same sequential probe path and why long runs of occupied slots (primary clustering) form.

Why this video

Gate Smashers is a widely used exam-prep channel known for slow, example-driven explanations, and this video is the standard starting point for the probe-sequence idea that the rest of the topic builds on.

Video 2: L-6.6: Quadratic Probing in Hashing with example

Gate Smashers · 7:41 · 690,427 views · 5y ago · captions — Watch on YouTube

About this video

This video covers quadratic probing, where the offset from the home slot grows as a square (1, 4, 9, and so on) rather than by one each time. It is presented as a direct response to the clustering problem in linear probing, so expect a comparison with the previous method and a worked insertion example. Likely points include the probe formula itself and the caveat that quadratic probing may fail to find an empty slot even when one exists, depending on table size.

Why this video

It is the natural follow-up in the same instructor's sequence, so the notation and example style carry over, and it directly addresses the Quadratic Probing and Probe Sequences subtopics.

Video 3: L-6.7: Double Hashing | Collision Resolution Technique

Gate Smashers · 10:28 · 723,043 views · 5y ago · captions — Watch on YouTube

About this video

An explanation of double hashing, in which a second, independent hash function determines the step size used to move through the table after a collision. The description frames it around the core question of what happens when two keys land on the same spot, so expect the two-function formula and a traced example of the resulting probe sequence. It typically also covers why the secondary hash must never return zero and why its result should be relatively prime to the table size.

Why this video

Double hashing is the most effective of the three at spreading probes and eliminating clustering, and this video completes the Gate Smashers trio so you can compare all three techniques using consistent terminology.

How These Videos Support the Learning Outcomes

Together these three videos give you the open addressing half of MO2: each one presents a distinct probe strategy with a worked example, so you can line them up against separate chaining and against each other in terms of memory layout, clustering behavior, and the constraints they place on the table. The clustering discussions and the fact that all elements must fit inside the array connect directly to MO3, since growing clusters and a load factor approaching 1 are precisely what pull lookup away from O(1) toward linear-time scans. The videos also reinforce MO1, because every probe sequence starts from a hash value and depends on that hash distributing keys evenly. Note that deletion with tombstones and the JavaScript chaining implementation in MO4 are handled in your course readings and coding work rather than in these videos, so treat the videos as conceptual grounding and bring the deletion question with you when you build your own table.

About These Videos

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.