Resource · Guide or article
Hash Table
Short explainer on hash maps: a hash function turns a key into a bucket index, and imperfect hashing means collisions have to be handled somehow.
Reviewed
Open the original: Hash Table (opens the original site in a new tab)Add to a roadmap
Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.
Source content: English
Read this in other languages: 简体中文, Русский, 日本語, Français, Português, 한국어, Українська In computing, a hash table (hash map) is a data structure which implements an associative array abstract data type, a structure that can map keys to values. A hash table uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be found Ideally, the hash function will assign each key to a unique bucket, but most hash table designs employ an imperfect hash function, which might cause hash collisions where the hash function generates the same index for more than one key. Such collisions must be accommodated in some way.
PrepKit overview
PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.
- Suited to
- The source does not state a level
- Format
- Reference
What it covers
- Key-to-bucket mapping and why collisions occur
- Diagram of collisions resolved by separate chaining
How to use it
PrepKit study advice, not a claim made by the source.
Build a hash map with separate chaining and a resize step, then explain how the load factor affects lookup time.
Scope and limitations
No complexity table, no open addressing and no discussion of resizing. Only chaining appears, and only as a diagram.
Access and format
Short README on GitHub, trekhleb/javascript-algorithms (MIT), with seven translations linked. English, free.
Reviewed by PrepKit on Oct 2, 2026. Listing source commit: 85293e3e2b88
Evidence behind this overview
- src/data-structures/hash-table/README.md
Pages that include this
Get the PrepKit newsletter
Optional. You don't need it to use PrepKit.