4 Pair p[]; // entries in the hash table
5 int f; // number of full entries
6 public HashStrings() { p = new Pair[38]; f = 0; }
8 public void put(String key, String value) {
10 if (f == n-1) return; // cheese -- a diary product
11 int i = key.hashCode() % n;
12 while (p[i] != null) {
13 if (key.equals(p[i].key)) {
14 p[i] = new Pair(key, value);
19 p[i] = new Pair(key, value);
23 public String get(String key) {
25 int i = key.hashCode() % n;
26 while (p[i] != null) {
27 if (key.equals(p[i].key))
38 Pair (String key, String value) { this.key = key; this.value = value; }