Hashing - File Organization File: Sequence of records...

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

View Full Document Right Arrow Icon
File Organization File: Sequence of records Fixed-length vs. Variable-length records Records are stored to Disk blocks Spanned vs. Unspanned Organization How to Allocate Disk blocks to disk? Contiguous vs. Linked Allocation File Organization Unordered vs. Ordered Hashing
Background image of page 1

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

View Full DocumentRight Arrow Icon
Hashing Map field values to addresses H(field value) address of record H(k) = k mod M ASCII codes for ASCII Pick random digits of hash field value 47 37 55 21 0 1 2 3 4 5 6 7 8 9 35 27 14 47 37 55 21 0 1 2 3 4 5 6 7 8 9 35 27
Background image of page 2
External Hashing for Disk Files Bucket: One disk block or cluster of contiguous blocks (like fixed-size chaining) Hashing maps a key to a bucket number (which is then mapped to a physical block) 10 40 50 20 80 30 41 39 19 69 Bucket # 0 1 9 Collision? Less problem. (many records in a bucket)
Background image of page 3

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

View Full DocumentRight Arrow Icon
External Hashing M : buckets m : max # of records in a bucket What is best M,m? If # of records << m*M Unused space If # of records >> m*M Collisions Solution 1: Reorganize with a larger/smaller M, and a new hash function Solution 2: Dynamic Hashing
Background image of page 4
Dynamic Hashing Static hashing: hash address space is fixed.
Background image of page 5

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

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

This note was uploaded on 04/10/2008 for the course CSE 671 taught by Professor Hakanferhatosmanoglu during the Fall '06 term at Ohio State.

Page1 / 28

Hashing - File Organization File: Sequence of records...

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

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