Data Structures - Hashtables
Keypoints
-
- Data is formed of a key-value pair.
- Key is used to store and retrieve assossiated values.
- Uses a Hashing function that uses the key to determine where in the underlyingn data structure the data is stored and later for retrievals.
-
- On average lookup, deletion and insertion has a constant runtime complexity.
- Depeneds on the efficiency of hashing function and collision handling strategy.
- In an Array implementation: Keys go through hash function that determine its location in the array, it gets stored after that according to the collision strategy - chaining or probing.
Read more about Hashtables on WikiPedia