codeintuition-logo

Introduction to separate chaining


Now that we know what a hash table is and the operations it supports, we can dive deeper into how hash tables deal with collisions. Separate chaining is one such way of collision resolution in hash tables. As the name suggests, the internal array is an array of a chain-like data structure in the separate chaining implementation of a hash table. This data structure can simultaneously hold more than one data item, which is exactly how collisions are resolved. All the keys with the same hash value are stored at the hashed index, forming a data chain.

Loading Image

Logical representation of separate chaining implementation of a hash table

We can implement the chain using a linked list, dynamic array, or a self-balancing binary search tree as the data structure. The most common separate chaining implementation uses a doubly linked list, which we will use in this course.

Liking the course? Check our discounted plans to continue learning.