
- Data Structures & Algorithms
- DSA - Home
- DSA - Overview
- DSA - Environment Setup
- Algorithm
- DSA - Algorithms Basics
- DSA - Asymptotic Analysis
- DSA - Greedy Algorithms
- DSA - Divide and Conquer
- DSA - Dynamic Programming
- Data Structures
- DSA - Data Structure Basics
- DSA - Array Data Structure
- Stack & Queue
- DSA - Stack
- DSA - Expression Parsing
- DSA - Queue
- Searching Techniques
- DSA - Linear Search
- DSA - Binary Search
- DSA - Interpolation Search
- DSA - Hash Table
- Sorting Techniques
- DSA - Sorting Algorithms
- DSA - Bubble Sort
- DSA - Insertion Sort
- DSA - Selection Sort
- DSA - Merge Sort
- DSA - Shell Sort
- DSA - Quick Sort
- Graph Data Structure
- DSA - Graph Data Structure
- DSA - Depth First Traversal
- DSA - Breadth First Traversal
- Tree Data Structure
- DSA - Tree Data Structure
- DSA - Tree Traversal
- DSA - Binary Search Tree
- DSA - AVL Tree
- DSA - Spanning Tree
- DSA - Heap
- DSA Useful Resources
- DSA - Questions and Answers
- DSA - Quick Guide
- DSA - Useful Resources
- DSA - Discussion
Hashing by Multiplication in Data Structure
Here we will discuss about the hashing with multiplication method. For this we use the hash function −
β(π₯) = ⌊ππ₯π΄⌋ πππ π
Here A is a real-valued constant. The advantage of this method is that the value of m is not so critical. We can take m as power of 2 also. Although any value of A gives the hash function, but some values of A are better than others.
According to Knuth, we can use the golden ratio for A, So A will be
$$A=\frac{\sqrt5-1}{2}=0.61803398$$
Of course, no matter what value is chosen for A. The pigeonhole principle implies that if u ≥ nm, then there will be one hash value i and some S ⊆ U of size n, such that h(x) = i for all x in S.
So we can say that the worst case hashing by multiplication is as bad as hashing by division.
- Related Articles
- Hashing by Division in Data Structure
- Universal Hashing in Data Structure
- Double Hashing in Data Structure
- Asymmetric Hashing in Data Structure
- LCFS Hashing in Data Structure
- Hashing with Chaining in Data Structure
- Robin-Hood Hashing in Data Structure
- Hashing with Open Addressing in Data Structure
- Rectangle Data in Data Structure
- Deaps in Data Structure
- Quadtrees in Data Structure
- Halfedge data structure
- Explain estimation by multiplication.
- Booleβs Inequality in Data Structure
- Bayesβ Rule in Data Structure

Advertisements