






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Today: Hashing ( Data Structures Chapter 7).
Next topic: Sorting ( Data Structures Chapter 8).
...
300 100 1500
201 1
1199
108 1 2 11 3 102 309 18 9
h(s) = s 0 · 31 n−^1 + s 1 · 31 n−^2 +... + sn− 1 computed modulo 232 as in Java int arithmetic.
int r; r = 0; for (int i = 0; i < s.length (); i += 1) r = (r << 5) - r + s.charAt (i);
map.put (key, value); // Map KEY -> VALUE. // VALUE last mapped to by SOMEKEY. ... map.get (someKey) // VALUE last mapped to by SOMEKEY. ... map.containsKey (someKey) // Is SOMEKEY mapped? ... map.keySet () // All keys in MAP (a Set)