Abstract

This paper aims to reduce the time taken to search for data within a hash table by making use of a tree structure. The two most popular methods for collision avoidance within a hash table — Open Addressing and Separate Chaining each have their merits and demerits. Here we attempt to overcome the main demerits of each of these techniques which are — Filling up of the hash table in Open Addressing and Poor searching time in Separate Chaining. A different approach to the problem has been proposed here which prevents the filling up of the hash table by using a Binary Search Tree instead of a table to store the hash values and adds new nodes to this tree only when a new hash value is generated while entering data. Also, in place of using linked list to store the data within a hash bucket, we use another Binary Search Tree to reduce the search time within each hash bucket. Using this approach, we attempt to reduce both the amount of space and time that will be used as there would be no empty buckets for any hash values and we do not have to worry about filling up the hash table as we will be chaining the data under each bucket. We also try to take care of the main drawback of Separate Chaining i.e longer search time within a hash bucket, by using a Binary Search Tree instead of a linked list, thus reducing the worst case search time from O(n) to O(log n).

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call