HASHMAPS
HASHMAPS
It helps us to understand how we can store, update and delete the data in constant time. It is majorly used in Dynamic Programming and Graphs to help us make the time complexities of the algorithms better.
Introduction to Hashmaps
Introduction to Hashmaps
What is hashing?
Hashing is defined as the process in which data, regardless of its size is taken, and converted into a fixed-size value or key. This conversion is done using hashing function.
Hashing is often done to quickly store and retrieve ...
Hash Table Operations
Hash Table Operations
Several operations can be performed on hash tables. We will discuss each of them.
- Create a hash table: To create a hash table, a node with key and value is required and a hash table that contains addresses of node*.
Hash functions can be...
Different Components of Hashing
Different Components of Hashing
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 ...
Hash Table and Function
Hash Table and Function
What is 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 nod...
Collision Resolution Techniques
Collision Resolution Techniques
Collision resolution techniques are used in hash tables to handle situations where two different keys map to the same hash code. When a collision occurs, these techniques help resolve the collision and find an appropriate location for storing the coll...
Comparison of Collision Resolution Techniques
Comparison of Collision Resolution Techniques
- Linear Probing vs Double Hashing
|Characteristics |Linear Probing|Double Hashing| | :- | :- | :- | |Probing sequence|
hash(key) + i
|hash(key) + i * hash2(key)| |Primary clustering|Susceptible to primary cluste...How Hashing Gets O(1) Complexity and Hashing Techniques
How Hashing Gets O(1) Complexity and Hashing Techniques
In hashing, hash key is calculated in O(1) time complexity and the required location in hash table is accessed in O(1).
Insertion: In average case, while insertion, hash code of key is generated in O(1). The last node of list is also reached in const...
Different Problems for which hash tables are not suitable
Different Problems for which hash tables are not suitable
While hash tables are versatile data structures with numerous advantages, there are certain scenarios or problems for which they may not be the most suitable choice. Here are some examples:
Implementation of a separate chaining collision resolution technique
Implementation of a separate chaining collision resolution technique
Algorithm:
-
-
Choo...
Standard Template Library STL
Standard Template Library STL
In C++, the Standard Template Library (STL) provides the ‘unordered_map’ container, which implements a hash table-based associative array. It allows efficient key-value lookup and provides several member functions for manipulating and accessing eleme...
Library
WEB DEVELOPMENT
FAANG QUESTIONS