Hashing
Hashing
HASHING
DEFINATION:
It is a Dynamic Hashing Method where in directories and buckets are
• Local Depth: It is the same as that of Global Depth except for the fact
that Local Depth is associated with the buckets and not the directories.
Local depth in accordance with the global depth is used to decide the
action that to be performed in case an overflow occurs. Local Depth is
always less than or equal to the Global Depth.
Directory
Points to a Bucket
Data
traverse
s
to the
Bucket
bucket
Data hashed/stored here
• Step 1 - Analyze Data Elements: Data elements may exist in
various forms eg. Integer, String, Float, etc.. Currently, let us
consider data elements of type integer.
eg: 49.
• Case2: In case the local depth is less than the global depth,
then only Bucket Split takes place. Then increment only the local
depth value by 1. And, assign appropriate pointers.
Overflow occurs
Perform bucket
Perform bucket
split &directory
split
expansion
• Step 8 - Rehashing of Split Bucket Elements: The Elements
present in the overflowing bucket that is split are rehashed w.r.t
the new global depth of the directory.