Different Components of Hashing
Published by
sanya sanya
Process of hashing mainly has four key components:
-
Hash Table: Hash table is a data structure that maps keys to values using hash functions. Hash holds the data in an array in an associated fashion, giving each data value a distinct index. It stores an array of pointers which point to node*.
-
Hash Functions: Hash functions are special functions that convert a received input key to an index of array called hash table. This index is known as hash code or hash value.
-
Collisions: Collision in hashing occurs when two different inputs (or keys) produce the same hash code or hash value, i.e., when hash function generates the same index for two different keys. Collision occurs as there is a problem in placing two or more keys at the same index.
-
Collision Resolution Techniques: There are few techniques or methods to resolve collision caused due to generation of same hash code for different keys. There are mainly two ways of handling collision: Separate Chaining (Open Hashing) and Open Addressing (Closed Hashing).
Library
WEB DEVELOPMENT
FAANG QUESTIONS