week5 - HASHING Static Files Expandable Files Still we can...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: HASHING Static Files Expandable Files Still we can add, Extendible Hashing delete records Linear Hashing Dynamic Hashing Hash Function Key m-1 HF = mod(key,m) HF(ki)=HF(kj) ki != kj collision We must find a collision resolution method Prime Data Area Overflow Area A bucket has several blocks. It can store many blocks as long as we have room for a new record collision is no problem. Example: Bkfr=3 (Bucket Factor) HF=mod(key,5) Key values : 35, 71, 33, 19, 22, 60, 42, 46, 47, 17 Key HF=mod(key,5) Collision(N/Y) Prime Overflow Data Area Area 35 60 35 mod (35,5)=0 N 71 mod (71,5)=1 N 71 46 33 3 N 1 19 4 N 17 22 42 47 47 22 2 N 2 60 N 33 42 2 N 3 46 1 N 19 47 2 N 4 17 2 Y To decrease number of collisions keep prime data area size > the number of records to be inserted to the files. N number of records in file LF= M x Bkfr Bucket Factor Load Factor LF= 10= 0,66 %66 5x3 T F =one disk access = s + r + dtt Time needed to read one bucket X: Average overflow chain length T F(successful) = s + r + dtt + (x/2) * (s + r + dtt) T F(unsuccessful) = s + r + dtt + x * (s + r + dtt) Lower load factors means less collision and shorter access time. Large bucket factor also means less overflow....
View Full Document

Page1 / 10

week5 - HASHING Static Files Expandable Files Still we can...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online