public void put(Key key, Value val) {
        if (val == null) {
            delete(key);
            return;
        }
        
        // double table size if average length of list >= 10
        if (N >= 10 * M) {
            resize(2 * M);
        }
        
        int i = hash((String)key);
        if (!st[i].contains(key)) {
            N++;
        }
        st[i].put(key, val);
    }