- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Hashing with Chaining in Data Structure
In this section we will see what is the hashing with chaining. The Chaining is one collision resolution technique. We cannot avoid collision, but we can try to reduce the collision, and try to store multiple elements for same hash value.
this technique suppose our hash function h(x) ranging from 0 to 6. So for more than 7 elements, there must be some elements, that will be places inside the same room. For that we will create a list to store them accordingly. In each time we will add at the beginning of the list to perform insertion in O(1) time
Let us see the following example to get better idea. If we have some elements like {15, 47, 23, 34, 85, 97, 65, 89, 70}. And our hash function is h(x) = x mod 7.
The hash values will be
The Hashing with chaining will be like −
- Related Articles
- Hashing with Open Addressing in Data Structure
- C++ program for hashing with chaining
- Universal Hashing in Data Structure
- Double Hashing in Data Structure
- Asymmetric Hashing in Data Structure
- LCFS Hashing in Data Structure
- Hashing by Division in Data Structure
- Hashing by Multiplication in Data Structure
- Robin-Hood Hashing in Data Structure
- Rectangle Data in Data Structure
- Deaps in Data Structure
- Quadtrees in Data Structure
- Halfedge data structure
- Arrays Data Structure in Javascript
- Stack Data Structure in Javascript
