# lec07 - 6.006 6.006- Introduction to to Algorithms Lecture...

This preview shows pages 1–8. Sign up to view the full content.

.006- troduction to 6.006 Introduction to Algorithms Lecture 7 Prof. Manolis Kellis CLRS: 11.4, 17.

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

View Full Document
Unit #2 – Genomes, Hashing, and Dictionaries 2
Unit #2: Hashing Last Tues: Genomes, Dictionaries, Hashing – Intro, basic operations, collisions and chaining – Simple uniform hashing assumption Last Thur: Faster hashing, hash functions – Hash functions in practice: div/mult/python – Faster hashing: Rolling Hash: O( n 2 ) O( n lg n ) – Faster comparison: Signatures: mismatch time Today: Space issues – Dynamic resizing and amortized analysis – Open addressing, deletions, and probing – Advanced topics: universal hashing, fingerprints 3

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

View Full Document
Today: Hashing I Ι I: Space issues Rev: Hash functs, chaining, SUHA, rolling, signatures Dynamic dictionaries: Resizing hash tables When to resize: insertions, deletions Resizing operations, amortized analysis Open addressing: Doing away w/ linked lists perations: insertion, deletion Operations: insertion, deletion Probing: linear probing, double hashing erformance analysis: UHA, open vs. chaining Performance analysis: UHA, open vs. chaining Advanced topics: Randomized algorithms (shht!) Universal hashing, perfect hashing Fingerprinting, file signatures, false positives
Remember Hashing I and II ashing and hash functions • Hashing and hash functions Humongous universe of keys itty bitty little space • Hash table as dictionary Insert/Search/Delete • Collisions by chaining uild a linked list in each bucket Build a linked list in each bucket Operation time is length of list • Simple Uniform Hashing Assumption Every item to uniform random bucket n items in size m table average length n/m = α peeding up hashing • Speeding up hashing Rolling Hash: fast sequence of hash’s Signatures: fast comparison, avoid frequent mismatches • Comparing genomes O(n 4 ) O binsearchL (n 3 lgn) O hash (n 2 lgn) O roll/sign (nlgn)

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

View Full Document
Today: Hashing I Ι I: Space issues Rev: Hash functs, chaining, SUHA, rolling, signatures Dynamic dictionaries: Resizing hash tables When to resize: insertions, deletions Resizing operations, amortized analysis Open addressing: Doing away w/ linked lists perations: insertion, deletion Operations: insertion, deletion Probing: linear probing, double hashing erformance analysis: UHA, open vs. chaining Performance analysis: UHA, open vs. chaining Advanced topics: Randomized algorithms (shht!) Universal hashing, perfect hashing Fingerprinting, file signatures, false positives
Dynamic Dictionaries In substring application, inserted all at once then scanned More generally, arbitrary sequence of insert, delete, find How do we know how big the table will get? hat if we guess wrong?

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/11/2011 for the course MATH 180 taught by Professor Byrns during the Spring '11 term at Montgomery College.

### Page1 / 36

lec07 - 6.006 6.006- Introduction to to Algorithms Lecture...

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

View Full Document
Ask a homework question - tutors are online