05 Hashing Part 1

05 Hashing Part 1 - Hashing, part 1 15-211: Fundamental...

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

View Full Document Right Arrow Icon
Hashing, part 1 15-211: Fundamental Data Structures and Algorithms Charlie Garrod 26 January 2010 Reading for today: Chapter 20
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Announcements HW 1 theory questions due now Programming due Thursday at 11:59 p.m. Recitation tomorrow Quiz 1 Bring the handout from last week
Background image of page 2
3 Lists, representation, and mutability C = A.join(B)? Or?: A empty B empty A B empty C empty A empty B empty C
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Lists in Java Linked lists Null terminated Object oriented Using an IntList interface Tabular Vector or Array IntListEmpty IntListCell IntList IntListCell IntList null IntList IntList IntList
Background image of page 4
5 Today: Hashing, part 1 Dictionaries and hash tables Handling hash collisions Separate chaining Open addressing and probing Hash functions Heuristics Universal hash functions Perfect hash functions Hashing and Java
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 The Dictionary Problem
Background image of page 6
7 The Dictionary Problem Store a set of associated key-value pairs Find(k) return the value associated with key k Insert(k,v) insert key k with value v Delete(k) delete key k (and its associated value)
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 The Dictionary Problem Store a set of associated key-value pairs Find(k) return the value associated with key k Insert(k,v) insert key k with value v Delete(k) delete key k (and its associated value) Possible implementations: Find Insert Delete sorted array T(n) =?
Background image of page 8
9 The Dictionary Problem Store a set of associated key-value pairs Find(k) return the value associated with key k Insert(k,v) insert key k with value v Delete(k) delete key k (and its associated value) Possible implementations: Find Insert Delete sorted array O(lg n ) ?
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 The Dictionary Problem Store a set of associated key-value pairs Find(k) return the value associated with key k Insert(k,v) insert key k with value v Delete(k) delete key k (and its associated value) Possible implementations: Find Insert Delete sorted array O(lg n ) O( n ) ?
Background image of page 10
11 The Dictionary Problem Store a set of associated key-value pairs Find(k) return the value associated with key k Insert(k,v) insert key k with value v Delete(k) delete key k (and its associated value) Possible implementations: Find Insert Delete sorted array O(lg n ) O( n ) O(lg n )?
Background image of page 11

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

View Full DocumentRight Arrow Icon
12 The Dictionary Problem Store a set of associated key-value pairs Find(k) return the value associated with key k Insert(k,v) insert key k with value v Delete(k) delete key k (and its associated
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 43

05 Hashing Part 1 - Hashing, part 1 15-211: Fundamental...

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

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