{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec0408-Hashing2-ann - Announcements MP 6 available Due...

Info icon This preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
Image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
Image of page 9

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

View Full Document Right Arrow Icon
Image of page 10
Image of page 11

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

View Full Document Right Arrow Icon
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Announcements: MP 6 available. Due 4/15. 11 :59p. No sections this week. Today: More Hashing - A Hash Table consists of: ’) .An array .A hash function 4A collision resolution strategy Hashing Strings (an example) ¢—?Given: 8 character strings are easy to hash The idea: Select 8 random positions from long strings and hash that substrlng. A bunch of strin : Lookyhara. suck. gInstr“) rich ain't going ——9 Lk f 0“ . . No! on. good-11cm: ara you An zaal daad Juat as doad earnest as X'II sitting hero nto the gone if you ain't respectable. y Can't lat Isa ln, Ton? Dldn't you lat .a Yos. but that's dttfarant. A total»: ts a ’ a - O trato ls -- as a qanatal thing. In rsoat ——J> Now, tea, haln't you always ban "loudly ut. would you. Tara? You wouldn’t do that Huck. I wouldn't want to. and I DON'T wa ay? why. thay'd say. 'xph! ‘ron Sauyaz'a tl' They'd man you. Much. You wouldn't uck was stlant fox sot-a tuna. engaged in “8+ Hall, 1'“ go back to tha nlddar to: a lid)“ ~ can coca to stand 1t. 1! you'll lat Ina All thht, Huck, lt's a lhlz! Cor-a along Nlll you. Tell -- now vlll you? That‘s 90 ha roughest things. I'll snota private a k hzouqh or bust. than you going to start fl “ft“ Oh. zlqht 02!. "0'11 got tha boys toqath I I d M . Hashing Strings (an example) Given: mamas an oasyb hash The i ‘ : Selectemndomposltlomflomlongstrlngaand hashtmuubsmng. A bunch of strings: .....> Mk 1.. / http://on.uulupodla.orq/utkt/Lo!CSI9Bna_Grobla - - http://onaukspocua.otq/nln/Blau_tho_m_bovn h::px//en.wauped1a.om/u1k1/5m_mc3\un1q T I httpx / /en .vikipedla .orq/It k1/ 2/ 7th_Covclry_Cmndo_Roqtmnt_ (Au-tron.) http: / /on.\ukspodta .orq/Iulll3o1mn_lbrnhu_mhulod_klL_AJ_Kh-11ta http: I/Ondllklpodla .orq/Itll/M1co_ulqh_5chool i! httpxl/onnukAp-odta.orq/vikt/Boautttul._Dttty._luch \ httpfllonaulupodla.orq/Itll/lrh_3|r_lod1voro_fl.3004) M WI http://on.vikipedto.orq/Itkt/Ixrthrlqht_tb¢nd) http://antikipedlc.orq/Itkt/JockyJM-ond Mg ht:p://on.uak1pocua.orq/vtlt/Vachon http: / len.v1k1ped1a .orq/wlki/Hctotthy_\ 26_Stono http://ennukApedia.om/v1k1/5011cbury._Nov_lhlpuh1rc http://on.vuupodta.orqlutltlA_L1no_ot_Doathloau_lunqo httpx / lonnulupodja .orqlain/ltovtoundland_1txlh httpx//on.v1kAp-od1a.orq/vikl/hatr1c¢_roltts http:l/onnukimdta.orq/Itkl/Bona_51)obet http://on. wikipodla. org/v1k1/50ur_undlnq httpz/lonmakspodla.orq/I1k1/Dr_uarnohan__31nqh Scholar-hip" .attpzllon. tulip-41:. org/u1u1u11q10n_1n_Jozdan 7p Hash Functions «:31 Typical apptoach: "randomize" the key via lit scramxling and than take a subset oftho scrambled bits. ‘ [91.19,%’,t6,5b~-'§"’ 1 Collision Handling - Separate Chaining (an example ofgpen hashlng) s={1§,§.3,1§.29,11.23} |S|=_rl “0&7.“ Separate Chaining: (an example of open hashing) S I {16. 8. 4, 13. 29. 11. 22} |S| I n h(k) I k%7 d=—"--°*W* - N 9““ (M M M6 d mswfwu. Collision Handling- Probe based hashing: (exampIeofclosed hashing) L 5‘ s=;?1:6.'§?f13 ‘39 11 2__2} |S|=n h(k)=k%7 H(,k H(o) :(kUA-v $7. k) iWMW Probe based hashing — 2 problemfiw rum Removals: Clusteri : Probe based hashing: (double hashing) S = {16. 8. 4, 13. 29, 11, 22} ISI = n H(k.l)= h,(k)+ I1,(k) 2“; km. A Qfi‘w SW «We ax W With. 0 0' b O N .5 -2. *8 d- N Whigs, count # of probes for Find(key) assuming simple unifon'n hash g Hash table performance: Quadratic and double hashing - K '. successful: NM “050% unsuccessful: Separate chaining - successful: °L/Z k M W unsuccessful: U» (Mulilpli bm'm inks Wt MM) ReHashing: What if the array fills? CCDZIZI Miscellaneous Discussion — if there’s time... What does a bad hash function look like? Why do we talk about balanwd BST If hashing I: so quick? Appllcatlons of hashing? Area of active research in mathematics to develop general purpose hash functions. ...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern