Code Skiller logoCB Logo
Logo LearnLearnLogo PracticePracticeLogo HireHireLogo IDEIDE

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

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 ...

Read more

Hash Table Operations

Several operations can be performed on hash tables. We will discuss each of them.

  1. 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...

Read more

Different Components of Hashing

Process of hashing mainly has four key components:

  1. 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 ...
Read more

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...

Read more

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...

Read more

Comparison of Collision Resolution Techniques

  1. 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...

Read more

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...

Read more

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:

  1. Ordered Data: Hash tables do not inherently mainta...
Read more

Implementation of a separate chaining collision resolution technique

Algorithm:

  1. Define a hash table data structure: Start by defining a hash table data structure that will store key-value pairs. Each element of the hash table will be a linked list that will handle collisions using separate chaining.

  2. Choo...

Read more

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...

Read more

Library

WEB DEVELOPMENT

FAANG QUESTIONS