Loading...
The foundation of fast data retrieval: Mapping keys to indices.
Section 0 of 0
The foundation of fast data retrieval: Mapping keys to indices.
See how keys are transformed into array indices in real-time.
Σ(charCodes) % 8A Hash Table uses a Hash Function to map keys (strings, objects, integers) to a finite number of slots in an array.
Crucial Fact: Because we compute the address directly from the data, we don't need to "look" through the table. We jump straight to the slot.
| Operation | Average | Worst |
|---|---|---|
| Insertion | O(1) | O(n) |
| Deletion | O(1) | O(n) |
| Search | O(1) | O(n) |
| Space | O(n) | O(n) |
* Worst case O(n) occurs when every key hashes to the same slot (maximum collisions).