Grokking Data Structures & Algorithms for Coding Interviews
Ask Author
Back to course home

0% completed

Hashing, Collisions, Overflow, and Resizing in Hashtables
Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

1️⃣ Understanding Hashing in Hashtables

A Hashtable stores key-value pairs using a hash function that converts a key into a numeric index in an array. This enables quick lookups, insertions, and deletions.

🔹 How Hashing Works:

  1. A key (e.g., Book ID: 1008) is passed through a hash function.
  2. The hash function computes an index based on the key (e.g., 1008 % 10 → 8).
  3. The value (e.g., "A1 Shelf") is stored at that index in the Hashtable.
    4

.....

.....

.....

Like the course? Get enrolled and start learning!

Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible