









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Students who are in 2nd CSE jntuk
Typology: Exams
1 / 17
This page cannot be seen from the preview
Don't miss anything!










RAGHU INSTITUTE OF TECHNOLOGY AUTONOMOUS DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
II BTECH II SEM Advanced Data Structures Unit- Prepared By Dr.V.Sangeetha & Mr. N.UdayKumar
Dynamic Hashing
Directory less Dynamic Hashing
References :
A Forouzan, Cengage.
Andersonfreed
2
Determine if a particular name is in the table
Retrieve the attributes of the name
Modify the attributes of that name
Insert a new name and its attributes
Delete a name and its attributes
4
Static Hashing is another form of the hashing problem
which allows users to perform lookups on a finalized
dictionary set (all objects in the dictionary are final and not
changing).
Example
7
The idea of hashing is to distribute the entries (key/value pairs) across an array
of buckets. Given a key, the algorithm computes an index that suggests where the
entry can be found:
index = f(key, array_size)
Often this is done in two steps:
hash = hashfunc(key) index = hash % array_size
In this method, the hash is independent of the array size, and it is then reduced to
an index (a number between 0 and array_size − 1) using the modulo operator (%).
In the case that the array size is a power of two, the remainder operation is
reduced to masking, which improves speed, but can increase problems with a
poor hash function.
*A good hash function and implementation algorithm are essential for good hash
table performance, but may be difficult to achieve.
A basic requirement is that the function should provide a uniform distribution of
hash values. A non-uniform distribution increases the number of collisions and the
cost of resolving them.
8
One common method of determining a hash key is the division
method of hashing.
The formula that will be used is:
hash key = key % number of slots in the table.
The division method is generally a reasonable strategy,unless the key
happens to have some undesirable properties.
The number of slots should not be :
a power of 2, since if m = 2
p
, then h ( k ) is just the p lowest order
bits of k
a power of 10, since then the hash function does not depend on
all the decimal digits of k
p
p
, two strings
that are identical except for a transposition of two adjacent
characters will hash to the same value.
10
11
1
11
12
1n
2
21
22
2n
m
m
m
mn
13
dynamically increasing and decreasing file
size
concepts
file: a collection of records
record: a key + data, stored in pages
(buckets)
space utilization
14
NumberOfPages PageCapaci ty
NumberOf cord
Re
Bloom Filters
17