SlideShare a Scribd company logo
1 of 14
Download to read offline
EXTENDIBLE HASHING
B.KOHILA
I –Msc(IT)
 Extendible hashing
 Expandable and dynamic hashing
 Virtual hashing
 Summary
2
OUTLINE
3
 Standard hashing works on fixed file size.
 What if we add / delete many keys?
What if the file sizes change significantly?
 Then we will develop separate techniques.
Two types:
- Directory schemes
- Directory less schemes
Hash Functions for Extendible Hashing
4
 Keys stored in buckets.
 Each bucket can only hold a fixed size of items.
 Index is an extendible table;
h(x) hashes a key value x to a bit map;
only a portion of a bit map is used to build a directory.
Example: buckets h(kn) = 11011
Add kn
b00 ********************************
b00
b01 b01
b10
Table
b1 b11
Extendible Hashing
00011
00110
00101
01100
01011
10011
11110
11111
00
01
10
11
00
01
10
11
10011
11011
11110
11111
5
 Directory schemes
- Extendible Hashing (Fagin et. al. 1979)
- Expandable hashing (Knott 1971)
- Dynamic Hashing (Larson 1978)
 Directory less schemes
- Virtual hashing (Litwin 1978)
Hash Functions for Extendible Hashing
6
 Size of a bucket = MAX # of pseudokeys (3 in our example)
 Once the bucket is full –
split the bucket into two
Two situation will be possible:
- Directory remains of the same size
adjust pointer to a bucket
- Size of directory grows from 2k to 2k+1
i.e. directory size can be 1, 2, 4, 8, 16 etc
(8 is shown in the figure).
The number of buckets will remain the same,
i.e. some references will point to the same bucket.
Finally, one can use bitmap to build the index but store an actual key in
the bucket!
Extendible Hashing
000
001
010
011
100
101
110
111
7
1. Use as much space as needed.
2. Input the file name, # of words to insert
Use bucket size: 128
3. Use any function h(k) that returns the string of bits of up to
32 bits (integer type can be used).
4. Bucket – char array
5. Main idea: only the FIRST bits of the mask are used for
search
Extendible Hashing
8
Assume that a hashing technique is applied to a dynamically changing file
composed of buckets, and each bucket can hold only a fixed number of items.
Extendible hashing accesses the data stored in
buckets indirectly through an index that is
dynamically adjusted to reflect changes in the file.
The characteristic feature of extendible hashing is the organization of the
index, which is an expandable table.
Extendible Hashing
9
 A hash function applied to a certain key indicates a position in the index
and not in the file (or table or keys). Values returned by such a hash
function are called pseudokeys.
 The file requires no reorganization when data are added to or deleted
from it, since these changes are indicated in the index.
Only one hash function h can be used, but depending on the size of the
index, only a portion of the added h(K) is utilized.
 A simple way to achieve this effect is by looking at the address into the
string of bits from which only the i leftmost bits can be used.
The number i is the depth of the directory.
In figure 1(a) (in the next slide), the depth is equal to two.
Extendible Hashing
10
Extendible Hashing
Figure 1. An example of extendible hashing
(Drozdek Textbook)
11
Expandable Hashing
 Similar idea to an extendible hashing.
But binary tree is used to store an index on the buckets.
Dynamic Hashing
 multiple binary trees are used.
Outcome:
- To shorten the search.
- Based on the key --- select what tree to search.
Expandable & Dynamic Hashing
12
 Larson method
 Index is simplified to be represented as a set of binary
trees.
 Height of each tree is limited.
 h(x) is searched in ALL trees.
Time: m – trees, k keys in each max, overall: m*lgk.
Advantage: shorter search time in index file
Dynamic Hashing
13
Litwin’s Virtual Hashing
 Expand buckets in a linear fashion.
 Store them continuously in the memory.
 No table is needed, the procedure is simple.
Virtual Hashing
14
Summary
 Extendible hashing advantages:
 Initially allocated space can increase indefinitely
 Location of a bucket where key belongs requires only very fast bits
comparison
 Very flexible in choosing size of the bucket, and allows their storage on
disks/remote memory access
 Extendible hashing disadvantages:
 Increased algorithm complexity
 Extra memory overhead to store index inside the bucket

More Related Content

Similar to extensiblehashing-191010111114.pdf

Lecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptx
Lecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptxLecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptx
Lecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptxROHIT738213
 
INDEXING AND HASHING UNIT 4 SILBERSCHATZ
INDEXING AND HASHING UNIT 4 SILBERSCHATZINDEXING AND HASHING UNIT 4 SILBERSCHATZ
INDEXING AND HASHING UNIT 4 SILBERSCHATZsathiyabcsbs
 
Bloom Filters: An Introduction
Bloom Filters: An IntroductionBloom Filters: An Introduction
Bloom Filters: An IntroductionIRJET Journal
 
Hashing and Hash Tables
Hashing and Hash TablesHashing and Hash Tables
Hashing and Hash Tablesadil raja
 
unit-1-dsa-hashing-2022_compressed-1-converted.pptx
unit-1-dsa-hashing-2022_compressed-1-converted.pptxunit-1-dsa-hashing-2022_compressed-1-converted.pptx
unit-1-dsa-hashing-2022_compressed-1-converted.pptxBabaShaikh3
 
4.4 hashing ext
4.4 hashing  ext4.4 hashing  ext
4.4 hashing extKrish_ver2
 
files,indexing,hashing,linear and non linear hashing
files,indexing,hashing,linear and non linear hashingfiles,indexing,hashing,linear and non linear hashing
files,indexing,hashing,linear and non linear hashingRohit Kumar
 
Overview of Storage and Indexing ...
Overview of Storage and Indexing                                             ...Overview of Storage and Indexing                                             ...
Overview of Storage and Indexing ...Javed Khan
 
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmmIndexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmmRAtna29
 
Hash Tables in data Structure
Hash Tables in data StructureHash Tables in data Structure
Hash Tables in data StructureProf Ansari
 
Algorithms notes tutorials duniya
Algorithms notes   tutorials duniyaAlgorithms notes   tutorials duniya
Algorithms notes tutorials duniyaTutorialsDuniya.com
 
5231 140-hellwig
5231 140-hellwig5231 140-hellwig
5231 140-hellwigsprdd
 

Similar to extensiblehashing-191010111114.pdf (20)

Lecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptx
Lecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptxLecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptx
Lecture14-Hash-Based-Indexing-and-Sorting-MHH-18Oct-2016.pptx
 
INDEXING AND HASHING UNIT 4 SILBERSCHATZ
INDEXING AND HASHING UNIT 4 SILBERSCHATZINDEXING AND HASHING UNIT 4 SILBERSCHATZ
INDEXING AND HASHING UNIT 4 SILBERSCHATZ
 
Bloom Filters: An Introduction
Bloom Filters: An IntroductionBloom Filters: An Introduction
Bloom Filters: An Introduction
 
Hashing and Hash Tables
Hashing and Hash TablesHashing and Hash Tables
Hashing and Hash Tables
 
unit-1-dsa-hashing-2022_compressed-1-converted.pptx
unit-1-dsa-hashing-2022_compressed-1-converted.pptxunit-1-dsa-hashing-2022_compressed-1-converted.pptx
unit-1-dsa-hashing-2022_compressed-1-converted.pptx
 
Assignment#12
Assignment#12Assignment#12
Assignment#12
 
Hashing PPT
Hashing PPTHashing PPT
Hashing PPT
 
4.4 hashing ext
4.4 hashing  ext4.4 hashing  ext
4.4 hashing ext
 
Hashing
HashingHashing
Hashing
 
Lec 1 indexing and hashing
Lec 1 indexing and hashing Lec 1 indexing and hashing
Lec 1 indexing and hashing
 
files,indexing,hashing,linear and non linear hashing
files,indexing,hashing,linear and non linear hashingfiles,indexing,hashing,linear and non linear hashing
files,indexing,hashing,linear and non linear hashing
 
Overview of Storage and Indexing ...
Overview of Storage and Indexing                                             ...Overview of Storage and Indexing                                             ...
Overview of Storage and Indexing ...
 
Indexing.ppt
Indexing.pptIndexing.ppt
Indexing.ppt
 
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmmIndexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
 
Hash Tables in data Structure
Hash Tables in data StructureHash Tables in data Structure
Hash Tables in data Structure
 
Ds 8
Ds 8Ds 8
Ds 8
 
FS Mod2@AzDOCUMENTS.in.pdf
FS Mod2@AzDOCUMENTS.in.pdfFS Mod2@AzDOCUMENTS.in.pdf
FS Mod2@AzDOCUMENTS.in.pdf
 
Algorithms notes tutorials duniya
Algorithms notes   tutorials duniyaAlgorithms notes   tutorials duniya
Algorithms notes tutorials duniya
 
Chapter 12 ds
Chapter 12 dsChapter 12 ds
Chapter 12 ds
 
5231 140-hellwig
5231 140-hellwig5231 140-hellwig
5231 140-hellwig
 

Recently uploaded

VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...
VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...
VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...SUHANI PANDEY
 
The Most Attractive Pune Call Girls Tingre Nagar 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Tingre Nagar 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Tingre Nagar 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Tingre Nagar 8250192130 Will You Miss Thi...ranjana rawat
 
Shake Shack: A Sustainable Burger Strategy
Shake Shack: A Sustainable Burger StrategyShake Shack: A Sustainable Burger Strategy
Shake Shack: A Sustainable Burger Strategykoolestankit
 
The Billo Photo Gallery - Cultivated Cuisine T1
The Billo Photo Gallery - Cultivated Cuisine T1The Billo Photo Gallery - Cultivated Cuisine T1
The Billo Photo Gallery - Cultivated Cuisine T1davew9
 
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...Pooja Nehwal
 
Top Rated Pune Call Girls JM road ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls JM road ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls JM road ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls JM road ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
Food & Nutrition Strategy Baseline (FNS.pdf)
Food & Nutrition Strategy Baseline (FNS.pdf)Food & Nutrition Strategy Baseline (FNS.pdf)
Food & Nutrition Strategy Baseline (FNS.pdf)Mohamed Miyir
 
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...Call Girls in Nagpur High Profile
 
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Sb Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Sb Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Sb Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Sb Road Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Booking open Available Pune Call Girls Sanaswadi 6297143586 Call Hot Indian ...
Booking open Available Pune Call Girls Sanaswadi  6297143586 Call Hot Indian ...Booking open Available Pune Call Girls Sanaswadi  6297143586 Call Hot Indian ...
Booking open Available Pune Call Girls Sanaswadi 6297143586 Call Hot Indian ...Call Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Sanghavi 8250192130 Will You Miss This Ch...
The Most Attractive Pune Call Girls Sanghavi 8250192130 Will You Miss This Ch...The Most Attractive Pune Call Girls Sanghavi 8250192130 Will You Miss This Ch...
The Most Attractive Pune Call Girls Sanghavi 8250192130 Will You Miss This Ch...ranjana rawat
 
(KRITIKA) Balaji Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(KRITIKA) Balaji Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(KRITIKA) Balaji Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(KRITIKA) Balaji Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] P...ranjana rawat
 
Top Call Girls Madhapur (7877925207) High Class sexy models available 24*7
Top Call Girls Madhapur (7877925207) High Class sexy models available 24*7Top Call Girls Madhapur (7877925207) High Class sexy models available 24*7
Top Call Girls Madhapur (7877925207) High Class sexy models available 24*7TANUJA PANDEY
 
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...ranjana rawat
 
(ANJALI) Shikrapur Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
(ANJALI) Shikrapur Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...(ANJALI) Shikrapur Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
(ANJALI) Shikrapur Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...ranjana rawat
 
Book Sex Workers Available Pune Call Girls Lavasa 6297143586 Call Hot Indian...
Book Sex Workers Available Pune Call Girls Lavasa  6297143586 Call Hot Indian...Book Sex Workers Available Pune Call Girls Lavasa  6297143586 Call Hot Indian...
Book Sex Workers Available Pune Call Girls Lavasa 6297143586 Call Hot Indian...Call Girls in Nagpur High Profile
 
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...ranjana rawat
 
Top Rated Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated  Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated  Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...
VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...
VIP Model Call Girls Alandi ( Pune ) Call ON 8005736733 Starting From 5K to 2...
 
The Most Attractive Pune Call Girls Tingre Nagar 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Tingre Nagar 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Tingre Nagar 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Tingre Nagar 8250192130 Will You Miss Thi...
 
Shake Shack: A Sustainable Burger Strategy
Shake Shack: A Sustainable Burger StrategyShake Shack: A Sustainable Burger Strategy
Shake Shack: A Sustainable Burger Strategy
 
The Billo Photo Gallery - Cultivated Cuisine T1
The Billo Photo Gallery - Cultivated Cuisine T1The Billo Photo Gallery - Cultivated Cuisine T1
The Billo Photo Gallery - Cultivated Cuisine T1
 
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
Ho Sexy Call Girl in Mira Road Bhayandar | ₹,7500 With Free Delivery, Kashimi...
 
Top Rated Pune Call Girls JM road ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls JM road ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls JM road ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls JM road ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Food & Nutrition Strategy Baseline (FNS.pdf)
Food & Nutrition Strategy Baseline (FNS.pdf)Food & Nutrition Strategy Baseline (FNS.pdf)
Food & Nutrition Strategy Baseline (FNS.pdf)
 
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
VVIP Pune Call Girls Viman Nagar (7001035870) Pune Escorts Nearby with Comple...
 
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Sb Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Sb Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Sb Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Sb Road Call Me 7737669865 Budget Friendly No Advance Booking
 
Booking open Available Pune Call Girls Sanaswadi 6297143586 Call Hot Indian ...
Booking open Available Pune Call Girls Sanaswadi  6297143586 Call Hot Indian ...Booking open Available Pune Call Girls Sanaswadi  6297143586 Call Hot Indian ...
Booking open Available Pune Call Girls Sanaswadi 6297143586 Call Hot Indian ...
 
All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
All Types👩Of Sex Call Girls In Mohali 9053900678 Romance Service Mohali Call ...
 
The Most Attractive Pune Call Girls Sanghavi 8250192130 Will You Miss This Ch...
The Most Attractive Pune Call Girls Sanghavi 8250192130 Will You Miss This Ch...The Most Attractive Pune Call Girls Sanghavi 8250192130 Will You Miss This Ch...
The Most Attractive Pune Call Girls Sanghavi 8250192130 Will You Miss This Ch...
 
(KRITIKA) Balaji Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(KRITIKA) Balaji Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] P...(KRITIKA) Balaji Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
(KRITIKA) Balaji Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] P...
 
Top Call Girls Madhapur (7877925207) High Class sexy models available 24*7
Top Call Girls Madhapur (7877925207) High Class sexy models available 24*7Top Call Girls Madhapur (7877925207) High Class sexy models available 24*7
Top Call Girls Madhapur (7877925207) High Class sexy models available 24*7
 
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
 
(ANJALI) Shikrapur Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
(ANJALI) Shikrapur Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...(ANJALI) Shikrapur Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
(ANJALI) Shikrapur Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
 
Book Sex Workers Available Pune Call Girls Lavasa 6297143586 Call Hot Indian...
Book Sex Workers Available Pune Call Girls Lavasa  6297143586 Call Hot Indian...Book Sex Workers Available Pune Call Girls Lavasa  6297143586 Call Hot Indian...
Book Sex Workers Available Pune Call Girls Lavasa 6297143586 Call Hot Indian...
 
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
Book Paid Chakan Call Girls Pune 8250192130Low Budget Full Independent High P...
 
Top Rated Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated  Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated  Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Pune Call Girls Dehu road ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
 

extensiblehashing-191010111114.pdf

  • 2.  Extendible hashing  Expandable and dynamic hashing  Virtual hashing  Summary 2 OUTLINE
  • 3. 3  Standard hashing works on fixed file size.  What if we add / delete many keys? What if the file sizes change significantly?  Then we will develop separate techniques. Two types: - Directory schemes - Directory less schemes Hash Functions for Extendible Hashing
  • 4. 4  Keys stored in buckets.  Each bucket can only hold a fixed size of items.  Index is an extendible table; h(x) hashes a key value x to a bit map; only a portion of a bit map is used to build a directory. Example: buckets h(kn) = 11011 Add kn b00 ******************************** b00 b01 b01 b10 Table b1 b11 Extendible Hashing 00011 00110 00101 01100 01011 10011 11110 11111 00 01 10 11 00 01 10 11 10011 11011 11110 11111
  • 5. 5  Directory schemes - Extendible Hashing (Fagin et. al. 1979) - Expandable hashing (Knott 1971) - Dynamic Hashing (Larson 1978)  Directory less schemes - Virtual hashing (Litwin 1978) Hash Functions for Extendible Hashing
  • 6. 6  Size of a bucket = MAX # of pseudokeys (3 in our example)  Once the bucket is full – split the bucket into two Two situation will be possible: - Directory remains of the same size adjust pointer to a bucket - Size of directory grows from 2k to 2k+1 i.e. directory size can be 1, 2, 4, 8, 16 etc (8 is shown in the figure). The number of buckets will remain the same, i.e. some references will point to the same bucket. Finally, one can use bitmap to build the index but store an actual key in the bucket! Extendible Hashing 000 001 010 011 100 101 110 111
  • 7. 7 1. Use as much space as needed. 2. Input the file name, # of words to insert Use bucket size: 128 3. Use any function h(k) that returns the string of bits of up to 32 bits (integer type can be used). 4. Bucket – char array 5. Main idea: only the FIRST bits of the mask are used for search Extendible Hashing
  • 8. 8 Assume that a hashing technique is applied to a dynamically changing file composed of buckets, and each bucket can hold only a fixed number of items. Extendible hashing accesses the data stored in buckets indirectly through an index that is dynamically adjusted to reflect changes in the file. The characteristic feature of extendible hashing is the organization of the index, which is an expandable table. Extendible Hashing
  • 9. 9  A hash function applied to a certain key indicates a position in the index and not in the file (or table or keys). Values returned by such a hash function are called pseudokeys.  The file requires no reorganization when data are added to or deleted from it, since these changes are indicated in the index. Only one hash function h can be used, but depending on the size of the index, only a portion of the added h(K) is utilized.  A simple way to achieve this effect is by looking at the address into the string of bits from which only the i leftmost bits can be used. The number i is the depth of the directory. In figure 1(a) (in the next slide), the depth is equal to two. Extendible Hashing
  • 10. 10 Extendible Hashing Figure 1. An example of extendible hashing (Drozdek Textbook)
  • 11. 11 Expandable Hashing  Similar idea to an extendible hashing. But binary tree is used to store an index on the buckets. Dynamic Hashing  multiple binary trees are used. Outcome: - To shorten the search. - Based on the key --- select what tree to search. Expandable & Dynamic Hashing
  • 12. 12  Larson method  Index is simplified to be represented as a set of binary trees.  Height of each tree is limited.  h(x) is searched in ALL trees. Time: m – trees, k keys in each max, overall: m*lgk. Advantage: shorter search time in index file Dynamic Hashing
  • 13. 13 Litwin’s Virtual Hashing  Expand buckets in a linear fashion.  Store them continuously in the memory.  No table is needed, the procedure is simple. Virtual Hashing
  • 14. 14 Summary  Extendible hashing advantages:  Initially allocated space can increase indefinitely  Location of a bucket where key belongs requires only very fast bits comparison  Very flexible in choosing size of the bucket, and allows their storage on disks/remote memory access  Extendible hashing disadvantages:  Increased algorithm complexity  Extra memory overhead to store index inside the bucket