# lecture05 - Lecture 5 Hashing I Chaining Hash Functions...

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

Lecture 5 Hashing I: Chaining, Hash Functions 6.006 Fall 2009 Lecture 5: Hashing I: Chaining, Hash Functions Lecture Overview Dictionaries Motivation — fast DNA comparison Hash functions Collisions, Chaining Simple uniform hashing “Good” hash functions Readings CLRS Chapter 11. 1, 11. 2, 11. 3. Dictionary Problem Dictionary: Abstract Data Type (ADT) maintaining a set of items , each with a key . E.g. (phonebook) keys are names, and their corresponding items are phone numbers E.g.2 (real dictionary) keys are english words, and their corresponding items are dictionary-entries Operations to Support : insert(item): add item to set delete(item): remove item from set search(key): return item with key if it exists Assumption: items have distinct keys (or that inserting new one clobbers old) Balanced BSTs solve in O (log n ) time per operation (in addition to inexact searches like nextlargest). What is the O ( · ) notation hiding? Reality: O (log n ) · key length — important distinction if key is not a number or key-length is larger than machine word. Our goal: O (1) time per operation (again we mean O (1) · key length). Using an idea called ‘Rolling Hash’ in the next lecture, we will sometimes manage to avoid paying the key length multiplicative penalty (on average). 1

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

View Full Document
Lecture 5 Hashing I: Chaining, Hash Functions 6.006 Fall 2009 Motivation Example Application: How close is chimp DNA to human DNA? Find the longest common substring of two strings, e.g. ALGORITHM
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/05/2010 for the course COMPUTER S 700 taught by Professor Joewhite during the Spring '10 term at Universidad San Martín de Porres.

### Page1 / 6

lecture05 - Lecture 5 Hashing I Chaining Hash Functions...

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

View Full Document
Ask a homework question - tutors are online