🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Programming Concepts Intermediate

What is Hash Table?

A data structure that maps keys to values using a hash function, providing average O(1) time complexity for lookups, insertions, and deletions.

Hash tables compute a hash of the key to determine where to store the value in an array. Collisions (different keys mapping to same index) are handled by chaining (linked lists) or open addressing (probing nearby slots).

Hash tables power dictionaries (Python dict), objects (JavaScript), HashMaps (Java), and associative arrays (PHP). They are the most commonly used data structure for fast key-based lookups. Performance degrades with many collisions or high load factors.

Related Terms

Code Smell
A surface indication in code that usually corresponds to a deeper problem in the system, suggesting the need for refactoring.
Technical Debt
The implied cost of additional rework caused by choosing a quick solution now instead of a better approach that would take longer.
Algorithm
A step-by-step procedure for solving a problem or performing a computation, defined as a finite sequence of instructions.
Singleton Pattern
A design pattern that restricts a class to a single instance and provides a global point of access to that instance.
Stack
A data structure that follows Last-In-First-Out (LIFO) ordering, where elements are added and removed from the same end (top).
Stack vs Heap
Two memory regions: the stack stores function call data with automatic cleanup, while the heap stores dynamically allocated objects.
View All Programming Concepts Terms →