You are on page 1of 2

CE204 

Data Structures and Algorithms:

Final Exam

By giving an example explain linear hashing technique.

Your report must be prepared in accordance with the following template.

Actions

1. Abstract

2. Definition of topic

3. Literature review

4. Explanation of each process as detailed as much.

5. References

Linear Hashing Technique: An Example

0.Author of the report: Miyrem Ali Hyusein NO:220502952


1. Abstract:
This report provides an explanation of the linear hashing technique using an example. Linear hashing
is a dynamic hashing technique that allows for efficient insertion and deletion of data in a hash table.
By utilizing a split and overflow mechanism, linear hashing effectively handles collisions and
maintains a balanced distribution of data. The example presented in this report will illustrate how
linear hashing operates step-by-step.

2. Definition of the Topic:


Linear hashing is a dynamic hashing technique that addresses the limitations of traditional static
hashing by allowing the hash table to expand or shrink dynamically based on the number of keys
being inserted or deleted. It utilizes a split and overflow mechanism to handle collisions and maintain
an evenly distributed hash table.

3. Literature Review:
The literature on linear hashing includes various research papers and publications. Key findings from
the literature review include:

- Linear hashing was introduced by Witold Litwin in 1980 as a technique to improve the performance
of hash tables in database systems.

- The split and overflow mechanism employed in linear hashing ensures a balanced distribution of
data and minimizes collisions.

- Linear hashing has been widely adopted in various database management systems and indexing
techniques due to its efficiency in handling dynamic data.

4. Explanation of Each Process:


Let's consider an example to illustrate the linear hashing technique:
Step 1: Initialization
- Start with an initial hash table of size 2, containing no keys.

- Maintain a global pointer to track the next split point.

Step 2: Insertion
- Insert key A into the hash table using the hash function.

- If there is no collision, store A in the corresponding bucket.

- If a collision occurs, split the bucket at the global split point.

- Adjust the split point and redistribute the keys between the original and new bucket.

- Continue this process for subsequent insertions.

Step 3: Deletion
- Delete a key B from the hash table.

- If the bucket containing B becomes empty, merge it with the neighboring bucket and update the
split point accordingly.

- Continue this process for subsequent deletions.

Step 4: Expansion or Contraction


- If the split point reaches the end of the hash table, double the size of the table and reset the split
point.

- If the number of keys in the hash table drops below a threshold, halve the size of the table and
reset the split point.

Step 5: Repeat Steps 2-4 as needed.

5. References:
1. Litwin, W. (1980). Linear hashing: A new tool for file and table addressing. In Proceedings of the
1980 ACM SIGMOD international conference on Management of data (pp. 212-223).

2. Silberschatz, A., Korth, H. F., & Sudarshan, S. (2010). Database System Concepts (6th ed.).
McGraw-Hill.

You might also like