Written on November 19, 2023
Basic explanation of hash maps and various nuances
Definition: Hashmaps is a data structure that is structured as a key-value pair. It is also known as a dictionary, map, or associative array.
Action | Time | Space |
---|---|---|
Access | O(1) | O(1) |
Set | O(1) | O(1) |
Remove | O(1) | O(1) |
Traverse/Search | ||
For a key | O(n) | O(1) |
For a value | O(n) | O(1) |