Hashing Techniques and Collision Resolution Methods in Data Structures
Resolving Collisions with Linked Lists
Colliding elements are stored in a linked list at the same address using pointers
Bucket Hashing
Data is placed into buckets based on certain characteristics instead of single slots
Digit Extraction
Selected digits from the key are extracted and combined to form the address
Subtraction Method
Subtracts a fixed memory location from the key to determine the address and is as limited as direct hashing
Modulo-Division
The address is key % list size and works with any list size but using a prime list size reduces collisions
Rotation Hashing
Rotates the last character of the key to the front often combined with other hashing methods and useful for serial keys
Folding Method (Shift)
The key is divided into equal-sized parts and these parts are added together to form the address
Mid-Square Hashing
The key is squared and the address is selected from the middle digits of the squared value
Direct Hashing
The key is used directly as the address with no algorithmic manipulation and requires an element for every possible key but has no collisions
Folding Method (Boundary)
The outer parts of the key are reversed before being added to the middle part
Pseudorandom Hashing
Uses the key as a seed in a pseudorandom number generator and scales the result using modulo division
