hashmap
HashMap is a data structure that stores key-value pairs and provides fast retrieval of values by their keys. It uses a hash function to compute an index into an internal array, called buckets, from which the value can be found. If multiple keys collide and map to the same bucket, the entries are stored in a secondary structure within that bucket, such as a linked list or a tree.
Typical operations include put(key, value), get(key), remove(key), and containsKey(key). On insertion, the key’s hash is computed
Hash maps rely on correct key equality semantics, such that two keys considered equal map to the
To maintain performance, hash maps resize when the load factor—the ratio of stored entries to the number
Variants and related structures include LinkedHashMap, which preserves insertion order, and ConcurrentHashMap, which provides thread-safe access.