/
Lecture  Hashing I Chaining Hash Functions Lecture  Hashing I Chaining Hash Functions

Lecture Hashing I Chaining Hash Functions - PDF document

phoebe-click
phoebe-click . @phoebe-click
Follow
417 views
Uploaded On 2015-05-12

Lecture Hashing I Chaining Hash Functions - PPT Presentation

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 Prob ID: 65962

006 Fall 2009 Lecture

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Lecture Hashing I Chaining Hash Functio..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Lecture5HashingI:Chaining,HashFunctions6.006Fall2009 MotivationExampleApplication:HowcloseischimpDNAtohumanDNA?Findthelongestcommonsubstringoftwostrings,e.g.ALGORITHM vs.ARITHM ETIC.Naivealgorithm?INPUT:twostringsS1,S2oflengthn.forl=n,n-1,...,1forallsubstringsx1ofS1oflengthlforallsubstringsx2ofS2oflengthlifx1==x2returnl;i.e.compareallpossiblesubstringsofthetwoDNAsequences|needs(n4)operations.Improvements?Candobinarysearch(how?)onthelengthofthelongestcommonsubstring,droppingdownthenumberofoperationsto(n3logn).!Usingdictionariescandropthisdownto(n2logn).Hereishow:Forallpossiblelengthsl:InsertallsubstringsofS1oflengthlintoadictionary;(thereareO(n)suchsubstrings,andeachinsertiontakesO(1)ltime)forallO(n)substringsofS2oflengthldoaO(1)llook-up!RunningtimeisO(n3).NowreplacingtheouterloopwithBinarySearchreducesthistoO(n2logn).2