SlideShare a Scribd company logo
1 of 17
 Sequential search requires, on the average O(n)
 Binary search requires much fewer comparisons on the average O (log
n)
 There is another widely used technique for storing of data called
HASHING. It does away with the requirement of keeping data sorted
(as in binary search)
 In its worst case, hashing algorithm starts behaving like linear search.
 Best case timing behavior of searching using hashing = O( 1)
 Worst case timing Behavior of searching using hashing = O(n)
 In hashing, the record for a key value "key", is directly referred by
calculating the address.
 Address or location of an element or record, x, is obtained by
computing some arithmetic function f. f(key) gives the address of x in
the table.
 There are two different forms of hashing.
 Open hashing or external hashing
◦ Open or external hashing, allows records to be stored in
unlimited space (could be a hard disk). It places no limitation
on the size of the tables.
Close hashing or internal hashing
◦ Closed or internal hashing, uses a fixed space for storage and
thus limits the size of hash table.
 The basic idea is that the records [elements] are
partitioned into B classes, numbered 0,1,2 … B‐l
 A Hashing function f(x) maps a record with key n to an
integer value between 0 and B‐l.
 Each bucket in the bucket table is the head of the linked list of
records mapped to that bucket.
 A closed hash table keeps the elements in the bucket
itself.
 Only one element can be put in the bucket
 If we try to place an element in the bucket f(n) and find
it already holds an element, then we say that a collision
has occurred.
 In closed hashing, collision handling is a very
important issue.
 Characteristics of a Good Hash Function
◦ A good hash function avoids collisions.
◦ A good hash function tends to spread keys evenly in the
array.
◦ A good hash function is easy to compute.
◦ A good hash function should be quick.
 Different hashing functions
◦ Division‐Method
◦ Midsquare Methods
◦ Folding Method
◦ Digit Analysis
◦ Length Dependent Method
◦ Algebraic Coding
◦ Multiplicative Hashing
 In this method we use modular arithmetic system to divide the key value by
some integer divisor m (may be table size).
 It gives us the location value, where the element can be placed.
 We can write,
L = (K mod m) + 1
where L => location in table/file K => key value
m => table size/number of slots in file
Suppose, k = 23, m = 10 then
L = (23 mod 10) + 1= 3 + 1=4, The key whose value is 23 is placed in
4th location.
 In this case, we square the value of a key and take the
number of digits required to form an address, from
the middle position of squared value.
 Suppose a key value is 16, then its square is 256.
Now if we want address of two digits, then you select
the address as 56 (i.e. two digits starting from middle
of 256).
combine the various parts of the key in such a
way that all parts of the key affect for final result
such an operation is termed folding of the key.
That is the key is actually partitioned into number
of parts, each part having the same length as that
of the required address.
Add the value of each parts, ignoring the final
carry to get the required address.
Fold‐shifting: Here actual values of each parts of key are added.
 Suppose, the key is : 12345678, and the required address is of
two digits, Then break the key into: 12, 34, 56, 78.
 Add these, we get 12 + 34 + 56 + 78 : 180, ignore first 1 we
get 80 as location
Fold‐boundary: Here the reversed values of outer parts of key
are added.
 Suppose, the key is : 12345678, and the required address is of
two digits, Then break the key into: 21, 34, 56, 87.
 Add these, we get 21 + 34 + 56 + 87 : 198, ignore first 1 we
get 98 as location
 This hashing function is a distribution dependent.
 Here we make a statistical analysis of digits of the key, and
select those digits (of fixed position) which occur quite
frequently.
 Then reverse or shifts the digits to get the address.
 For example, if the key is : 9861234. If the statistical analysis
has revealed the fact that the third and fifth position digits
occur quite frequently, then we choose the digits in these
positions from the key. So we get, 62. Reversing it we get 26
as the address.
 In this type of hashing function we use the length of the key
along with some portion of the key j to produce the address,
directly.
 In the indirect method, the length of the key along with some
portion of the key is used to obtain intermediate value.
 Here a n bit key value is represented as a polynomial.
 The divisor polynomial is then constructed based on the
address range required.
 The modular division of key‐polynomial by divisor
polynomial, to get the address‐polynomial.
 Let f(x) = polynomial of n bit key = a1 + a2x + ……. + anxn‐1
d(x) = divisor polynomial = x1 + d1 + d2x + …. + d1x1‐1
then the required address polynomial will be f(x) mod d(x)
 This method is based on obtaining an address of a key,
based on the multiplication value.
 If k is the non‐negative key, and a constant c, (0 < c <
1), compute kc mod 1, which is a fractional part of kc.
 Multiply this fractional part by m and take a floor value
to get the address
 H(k)= | m (kc mode 1) |
 0<H(k)<m

More Related Content

What's hot (20)

Hashing
HashingHashing
Hashing
 
Cluster analysis
Cluster analysisCluster analysis
Cluster analysis
 
Hash tables
Hash tablesHash tables
Hash tables
 
Hashing
HashingHashing
Hashing
 
Hashing and Hashtable, application of hashing, advantages of hashing, disadva...
Hashing and Hashtable, application of hashing, advantages of hashing, disadva...Hashing and Hashtable, application of hashing, advantages of hashing, disadva...
Hashing and Hashtable, application of hashing, advantages of hashing, disadva...
 
Hashing
HashingHashing
Hashing
 
Chap4
Chap4Chap4
Chap4
 
4.4 hashing
4.4 hashing4.4 hashing
4.4 hashing
 
Analysis and Design of Algorithms
Analysis and Design of AlgorithmsAnalysis and Design of Algorithms
Analysis and Design of Algorithms
 
14 Skip Lists
14 Skip Lists14 Skip Lists
14 Skip Lists
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption Standard
 
Fragmentation
FragmentationFragmentation
Fragmentation
 
05 Clustering in Data Mining
05 Clustering in Data Mining05 Clustering in Data Mining
05 Clustering in Data Mining
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Huffman codes
Huffman codesHuffman codes
Huffman codes
 
Data Structures : hashing (1)
Data Structures : hashing (1)Data Structures : hashing (1)
Data Structures : hashing (1)
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
 
B+ trees and height balance tree
B+ trees and height balance treeB+ trees and height balance tree
B+ trees and height balance tree
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Graph coloring problem
Graph coloring problemGraph coloring problem
Graph coloring problem
 

Viewers also liked

Indexing and hashing
Indexing and hashingIndexing and hashing
Indexing and hashingJeet Poria
 
11. Hashing - Data Structures using C++ by Varsha Patil
11. Hashing - Data Structures using C++ by Varsha Patil11. Hashing - Data Structures using C++ by Varsha Patil
11. Hashing - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
Concept of hashing
Concept of hashingConcept of hashing
Concept of hashingRafi Dar
 
Hashing and Hash Tables
Hashing and Hash TablesHashing and Hash Tables
Hashing and Hash Tablesadil raja
 
358 33 powerpoint-slides_15-hashing-collision_chapter-15
358 33 powerpoint-slides_15-hashing-collision_chapter-15358 33 powerpoint-slides_15-hashing-collision_chapter-15
358 33 powerpoint-slides_15-hashing-collision_chapter-15sumitbardhan
 
Hashing Technique In Data Structures
Hashing Technique In Data StructuresHashing Technique In Data Structures
Hashing Technique In Data StructuresSHAKOOR AB
 

Viewers also liked (10)

Hashing
HashingHashing
Hashing
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
Ch17 Hashing
Ch17 HashingCh17 Hashing
Ch17 Hashing
 
Hashing
HashingHashing
Hashing
 
Indexing and hashing
Indexing and hashingIndexing and hashing
Indexing and hashing
 
11. Hashing - Data Structures using C++ by Varsha Patil
11. Hashing - Data Structures using C++ by Varsha Patil11. Hashing - Data Structures using C++ by Varsha Patil
11. Hashing - Data Structures using C++ by Varsha Patil
 
Concept of hashing
Concept of hashingConcept of hashing
Concept of hashing
 
Hashing and Hash Tables
Hashing and Hash TablesHashing and Hash Tables
Hashing and Hash Tables
 
358 33 powerpoint-slides_15-hashing-collision_chapter-15
358 33 powerpoint-slides_15-hashing-collision_chapter-15358 33 powerpoint-slides_15-hashing-collision_chapter-15
358 33 powerpoint-slides_15-hashing-collision_chapter-15
 
Hashing Technique In Data Structures
Hashing Technique In Data StructuresHashing Technique In Data Structures
Hashing Technique In Data Structures
 

Similar to SEO-Optimized 40-Character Title on Hashing Algorithms

Hashing.pptx
Hashing.pptxHashing.pptx
Hashing.pptxkratika64
 
Sienna 9 hashing
Sienna 9 hashingSienna 9 hashing
Sienna 9 hashingchidabdu
 
Hashing and File Structures in Data Structure.pdf
Hashing and File Structures in Data Structure.pdfHashing and File Structures in Data Structure.pdf
Hashing and File Structures in Data Structure.pdfJaithoonBibi
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptxAgonySingh
 
Lecture14_15_Hashing.pptx
Lecture14_15_Hashing.pptxLecture14_15_Hashing.pptx
Lecture14_15_Hashing.pptxSLekshmiNair
 
Hash in datastructures by using the c language.pptx
Hash in datastructures by using the c language.pptxHash in datastructures by using the c language.pptx
Hash in datastructures by using the c language.pptxmy6305874
 
Algorithms notes tutorials duniya
Algorithms notes   tutorials duniyaAlgorithms notes   tutorials duniya
Algorithms notes tutorials duniyaTutorialsDuniya.com
 
Data Structures Design Notes.pdf
Data Structures Design Notes.pdfData Structures Design Notes.pdf
Data Structures Design Notes.pdfAmuthachenthiruK
 
DS Unit 1.pptx
DS Unit 1.pptxDS Unit 1.pptx
DS Unit 1.pptxchin463670
 
Advance algorithm hashing lec II
Advance algorithm hashing lec IIAdvance algorithm hashing lec II
Advance algorithm hashing lec IISajid Marwat
 
HASHING IS NOT YASH IT IS HASH.pptx
HASHING IS NOT YASH IT IS HASH.pptxHASHING IS NOT YASH IT IS HASH.pptx
HASHING IS NOT YASH IT IS HASH.pptxJITTAYASHWANTHREDDY
 
Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Kuntal Bhowmick
 
presentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptxpresentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptxjainaaru59
 

Similar to SEO-Optimized 40-Character Title on Hashing Algorithms (20)

Hashing .pptx
Hashing .pptxHashing .pptx
Hashing .pptx
 
Hashing.pptx
Hashing.pptxHashing.pptx
Hashing.pptx
 
Sienna 9 hashing
Sienna 9 hashingSienna 9 hashing
Sienna 9 hashing
 
Hashing and File Structures in Data Structure.pdf
Hashing and File Structures in Data Structure.pdfHashing and File Structures in Data Structure.pdf
Hashing and File Structures in Data Structure.pdf
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 
Lecture14_15_Hashing.pptx
Lecture14_15_Hashing.pptxLecture14_15_Hashing.pptx
Lecture14_15_Hashing.pptx
 
Data structure Unit-I Part-C
Data structure Unit-I Part-CData structure Unit-I Part-C
Data structure Unit-I Part-C
 
Hash in datastructures by using the c language.pptx
Hash in datastructures by using the c language.pptxHash in datastructures by using the c language.pptx
Hash in datastructures by using the c language.pptx
 
LECT 10, 11-DSALGO(Hashing).pdf
LECT 10, 11-DSALGO(Hashing).pdfLECT 10, 11-DSALGO(Hashing).pdf
LECT 10, 11-DSALGO(Hashing).pdf
 
Algorithms notes tutorials duniya
Algorithms notes   tutorials duniyaAlgorithms notes   tutorials duniya
Algorithms notes tutorials duniya
 
Hashing
HashingHashing
Hashing
 
Hashing.pptx
Hashing.pptxHashing.pptx
Hashing.pptx
 
Data Structures Design Notes.pdf
Data Structures Design Notes.pdfData Structures Design Notes.pdf
Data Structures Design Notes.pdf
 
DS Unit 1.pptx
DS Unit 1.pptxDS Unit 1.pptx
DS Unit 1.pptx
 
Advance algorithm hashing lec II
Advance algorithm hashing lec IIAdvance algorithm hashing lec II
Advance algorithm hashing lec II
 
HASHING IS NOT YASH IT IS HASH.pptx
HASHING IS NOT YASH IT IS HASH.pptxHASHING IS NOT YASH IT IS HASH.pptx
HASHING IS NOT YASH IT IS HASH.pptx
 
Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Hashing notes data structures (HASHING AND HASH FUNCTIONS)Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Hashing notes data structures (HASHING AND HASH FUNCTIONS)
 
Unit4 Part3.pptx
Unit4 Part3.pptxUnit4 Part3.pptx
Unit4 Part3.pptx
 
presentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptxpresentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptx
 
Bigdata analytics
Bigdata analyticsBigdata analytics
Bigdata analytics
 

More from Shyam Khant

More from Shyam Khant (8)

Unit2.data type, operators, control structures
Unit2.data type, operators, control structuresUnit2.data type, operators, control structures
Unit2.data type, operators, control structures
 
Introducing to core java
Introducing to core javaIntroducing to core java
Introducing to core java
 
C++
C++C++
C++
 
Php
PhpPhp
Php
 
C++ theory
C++ theoryC++ theory
C++ theory
 
C Theory
C TheoryC Theory
C Theory
 
Java script
Java scriptJava script
Java script
 
SQL
SQLSQL
SQL
 

Recently uploaded

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 

Recently uploaded (20)

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 

SEO-Optimized 40-Character Title on Hashing Algorithms

  • 1.
  • 2.  Sequential search requires, on the average O(n)  Binary search requires much fewer comparisons on the average O (log n)  There is another widely used technique for storing of data called HASHING. It does away with the requirement of keeping data sorted (as in binary search)  In its worst case, hashing algorithm starts behaving like linear search.  Best case timing behavior of searching using hashing = O( 1)  Worst case timing Behavior of searching using hashing = O(n)  In hashing, the record for a key value "key", is directly referred by calculating the address.  Address or location of an element or record, x, is obtained by computing some arithmetic function f. f(key) gives the address of x in the table.
  • 3.
  • 4.  There are two different forms of hashing.  Open hashing or external hashing ◦ Open or external hashing, allows records to be stored in unlimited space (could be a hard disk). It places no limitation on the size of the tables. Close hashing or internal hashing ◦ Closed or internal hashing, uses a fixed space for storage and thus limits the size of hash table.
  • 5.  The basic idea is that the records [elements] are partitioned into B classes, numbered 0,1,2 … B‐l  A Hashing function f(x) maps a record with key n to an integer value between 0 and B‐l.  Each bucket in the bucket table is the head of the linked list of records mapped to that bucket.
  • 6.
  • 7.  A closed hash table keeps the elements in the bucket itself.  Only one element can be put in the bucket  If we try to place an element in the bucket f(n) and find it already holds an element, then we say that a collision has occurred.  In closed hashing, collision handling is a very important issue.
  • 8.  Characteristics of a Good Hash Function ◦ A good hash function avoids collisions. ◦ A good hash function tends to spread keys evenly in the array. ◦ A good hash function is easy to compute. ◦ A good hash function should be quick.
  • 9.  Different hashing functions ◦ Division‐Method ◦ Midsquare Methods ◦ Folding Method ◦ Digit Analysis ◦ Length Dependent Method ◦ Algebraic Coding ◦ Multiplicative Hashing
  • 10.  In this method we use modular arithmetic system to divide the key value by some integer divisor m (may be table size).  It gives us the location value, where the element can be placed.  We can write, L = (K mod m) + 1 where L => location in table/file K => key value m => table size/number of slots in file Suppose, k = 23, m = 10 then L = (23 mod 10) + 1= 3 + 1=4, The key whose value is 23 is placed in 4th location.
  • 11.  In this case, we square the value of a key and take the number of digits required to form an address, from the middle position of squared value.  Suppose a key value is 16, then its square is 256. Now if we want address of two digits, then you select the address as 56 (i.e. two digits starting from middle of 256).
  • 12. combine the various parts of the key in such a way that all parts of the key affect for final result such an operation is termed folding of the key. That is the key is actually partitioned into number of parts, each part having the same length as that of the required address. Add the value of each parts, ignoring the final carry to get the required address.
  • 13. Fold‐shifting: Here actual values of each parts of key are added.  Suppose, the key is : 12345678, and the required address is of two digits, Then break the key into: 12, 34, 56, 78.  Add these, we get 12 + 34 + 56 + 78 : 180, ignore first 1 we get 80 as location Fold‐boundary: Here the reversed values of outer parts of key are added.  Suppose, the key is : 12345678, and the required address is of two digits, Then break the key into: 21, 34, 56, 87.  Add these, we get 21 + 34 + 56 + 87 : 198, ignore first 1 we get 98 as location
  • 14.  This hashing function is a distribution dependent.  Here we make a statistical analysis of digits of the key, and select those digits (of fixed position) which occur quite frequently.  Then reverse or shifts the digits to get the address.  For example, if the key is : 9861234. If the statistical analysis has revealed the fact that the third and fifth position digits occur quite frequently, then we choose the digits in these positions from the key. So we get, 62. Reversing it we get 26 as the address.
  • 15.  In this type of hashing function we use the length of the key along with some portion of the key j to produce the address, directly.  In the indirect method, the length of the key along with some portion of the key is used to obtain intermediate value.
  • 16.  Here a n bit key value is represented as a polynomial.  The divisor polynomial is then constructed based on the address range required.  The modular division of key‐polynomial by divisor polynomial, to get the address‐polynomial.  Let f(x) = polynomial of n bit key = a1 + a2x + ……. + anxn‐1 d(x) = divisor polynomial = x1 + d1 + d2x + …. + d1x1‐1 then the required address polynomial will be f(x) mod d(x)
  • 17.  This method is based on obtaining an address of a key, based on the multiplication value.  If k is the non‐negative key, and a constant c, (0 < c < 1), compute kc mod 1, which is a fractional part of kc.  Multiply this fractional part by m and take a floor value to get the address  H(k)= | m (kc mode 1) |  0<H(k)<m