14b: Hash Tables

ICS211, Spring 2013
Dr. Zach

(switch view)

Status

What about getting bits out of a byte?

ADT performance so far

Hash tables

Hash function

Collisions

Open addressing: Linear probing

Open addressing: Getting item back out

Open Addressing: Removal

Avoiding collisions: Load factor

Avoiding collisions: Hash fn

Avoiding collisions: Avoiding clusters

Chaining

Chaining: Try it

Chaining Limitations

Iteration

Summary

Job Interview Question #1

Given an int array A and an int value X, 
 print all index pairs (i,j) such that A[i] + A[j] == X.

Job Interview Question #2

Given a string, titlecase all of the words in that string.
(Titlecase = intialial capital letter and the rest lowercase.)

For next time...