An Hash Map is a data structure which uses a hash function in order to index the items.
Assuming no hash collisions, the hash map is a simple data structure, where each time we have to add a key, value element , we take , which will be the index where the value resides. Whenever we want to check what’s the value of , we hash it and see the value associated at that index. Because of this, operations like insertions, deletions and search have a complexity of .
Most hash maps use an imperfect hash function, meaning that collisions do happen, and their resolution make the data structure more complex.
related:
tags: data-structures