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

0% completed

Vote For New Content
Hashing, Collisions, Overflow, and Resizing in Hashtables
On this page

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!

On this page