Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

HASING

Beoordeling
-
Verkocht
-
Pagina's
15
Geüpload op
25-12-2024
Geschreven in
2024/2025

Basic Concepts of Hashing using C language

Instelling
Vak

Voorbeeld van de inhoud

Data Structures and Applications (CS204) Module 4


Module 5
Graphs: Definitions, Terminologies, Matrix and Adjacency List Representation of Graphs,
Elementary Graph operations.

Hashing: Hash Table organizations, Hashing Functions, Static and Dynamic Hashing

Summarization of all modules.

Case Studies:

a. Design a music playlist system: The functionality of a playlist needs to be implemented, i.e.,
adding a song to the playlist, playing the next song, playing the previous song, switching to a song,
display of songs based on its genre type etc.

b. Efficiently manage table reservations for a restaurant: Managing table reservations for a
restaurant efficiently involves handling various aspects such as availability of tables, booking
requests, and ensuring a smooth flow of operations.
Text book1: 6.1, 6.2, 8.1, 8.2, 8.3
5.2 Hashing
Why Hashing?
Internet has grown to millions of users generating terabytes of content every day. So, if we
need to process a very large data set, we need a new technique called hashing that allows us to
update and retrieve any entry in constant time which means, the amount of time to perform the
operation does not depend on data size n.
Hashing is a process of converting a data set of variable size into a data set of a fixed size.
Two types of hashing – static hashing and dynamic hashing.


5.2.1 Static Hashing
In static hashing the key and its index (pair) are stored in a table, ht, called the hash table. The
hash table is partitioned into b buckets, ht[0], …, ht[b-1]. A bucket is said to consist of s slots, each


Prof.V.Sonia Devi, Dept. of CSE, CITech 2024-25 Page 1

, Data Structures and Applications (CS204) Module 4

slot being large enough to hold one pair (key and its index). Usually s=1, and each bucket can hold
exactly one pair. The address or location of key k is determined by a hash function, h, which maps
keys into buckets. Thus for any key k, h(k) is an integer in the range 0 through b-1. h(k) is the hash
of k.


Hash table Organization
Hash table is a data structure in which keys are mapped into its respective index by using a hash
function.

Hashing is a technique to convert a range of key values into a range of indexes of an array.
Hashing is method of inserting data into hash table.

In a hash table, data is stored in an array format, where each data value has its own unique index value.
Access of data becomes very fast if we know the index of the desired data.


Thus, it becomes a data structure in which insertion and search operations are very fast irrespective of the
size of the data (Retrieving the element in one search). Hash Table uses an array as a storage medium and
uses hash technique to generate an index where an element is to be inserted or is to be located from.


Hashing Functions

1.Division Method (Remainder method)


It is the most simple method of hashing an integer x. This method divides x(key) by M(size of
table) and then uses the remainder obtained as the index to store key. In this case, the hash
function can be given as

h(x) = x mod M

Generally, it is best to choose M to be a prime number because making M a prime number
increases the likelihood that the keys are mapped with a uniformity in the output range of
values. (To reduce the number of collisions the table size should be chosen as a prime number).


Prof.V.Sonia Devi, Dept. of CSE, CITech 2024-25 Page 2

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
25 december 2024
Aantal pagina's
15
Geschreven in
2024/2025
Type
College aantekeningen
Docent(en)
Dr josephine kumar
Bevat
Hasing

Onderwerpen

$7.19
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
eharish3005

Maak kennis met de verkoper

Seller avatar
eharish3005 Cambridge Institute of Technology
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 jaar
Aantal volgers
0
Documenten
4
Laatst verkocht
-

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen