- Related Questions & Answers
- Boole’s Inequality in Data Structure
- Bayes’ Rule in Data Structure
- Substitution Method in Data Structure
- Find yesterday’s, today’s and tomorrow’s date in Python
- Yen's k-Shortest Path Algorithm in Data Structure
- Rectangle Data in Data Structure
- Sort an arrays of 0’s, 1’s and 2’s using C++
- Sort an arrays of 0’s, 1’s and 2’s using Java
- Difference Between Prim’s and Kruskal’s Algorithm
- Halfedge data structure
- Access to the underlying platform’s identifying data in Python
- Deaps in Data Structure
- Quadtrees in Data Structure
- Fleury’s Algorithm
- kasai’s Algorithm

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

In this section we will see what is Brent’s Method related to open addressed hashing. This method is a heuristic. This attempts to minimize the average time for a successful search in a hash table.

This method was originally applying on double hashing technique, but this can be used on any open addressing techniques like linear and quadratic probing. The age of an element x, is stored in an open addressing hash table, is the minimum value i, such that x is placed at A[x_{i}]

Brent’s Method tries to minimize the total age of all elements. If we insert an element x, then it will follow some steps − We will find smallest value of i, such that A[x_{i}] is empty, this is where standard open-addressing would insert x. Now consider one element y, which is stored at A[x_{i-2}]. This element is stored there because yj = x_{i-2}, for some value of j ≥ 0. We check if the array location A[y_{j+1}] is empty, then we move y to location A[y_{j+1}], and store x at location A[x_{i-2}].

Compared to normal open addressing, this decreases the total age by 1. In general Brent’s Method checks for each 2 ≤ k ≤ i, the array entry A[x_{i-k}] to see, if the element y is stored, there, can be moved to any of A[y_{j+1}], A[y_{j+2}], . . ., A[y_{j+k-1}], to make room for x.

Advertisements