Hashing in Data Structure

Last Updated : 3 Mar, 2026

Hashing is a technique used in data structures that efficiently stores and retrieves data in a way that allows for quick access.

  • Hashing involves mapping data to a specific index in a hash table (an array of items) using a hash function. It enables fast retrieval of information based on its key.
  • The great thing about hashing is, we can achieve all three operations (search, insert and delete) in O(1) time on average.
  • Hashing is mainly used to implement a set of distinct items (only keys) and dictionaries (key value pairs).

Here’s an example of hashing using the modulo method. The hash function H(x) = x % 10 converts any large number into a smaller value between 0 and 9.

frame_3274

Basics

Easy Problems

Medium Problems

Hard Problems

Quick Links :

Comment