05 Hashing Part 1

# 05 Hashing Part 1 - Hashing part 1 15-211 Fundamental Data...

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

Hashing, part 1 15-211: Fundamental Data Structures and Algorithms Charlie Garrod 26 January 2010 Reading for today: Chapter 20

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

View Full Document
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
3 Lists, representation, and mutability C = A.join(B)? Or?: A empty B empty A B empty C empty A empty B empty C

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

View Full Document
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
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

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

View Full Document
6 The Dictionary Problem
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)

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

View Full Document
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) =?
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 ) ?

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

View Full Document
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 ) ?
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 )?

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 43

05 Hashing Part 1 - Hashing part 1 15-211 Fundamental Data...

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

View Full Document
Ask a homework question - tutors are online