here are answers to some questions that have come in. ============= C++ strings from have value semantics, rather like the reference counted strings we did in class. so if you say String n = "name", v = "val"; Array a; a.put(n, v); that makes a["name"] = "val". if you subsequently say in the same function n = "foo"; v = "bar"; that has no effect on what was stored in the table and so a subsequent a.get("name") will return "val". ============= don't use realloc. allocate a new array of the right size, copy the elements one by one from the old table (basically using your put function), rehashing as you go, then delete the old table. ============= the grow function should not croak if you give it a value smaller than the current table size, but i didn't specify carefully what it should do. two obvious choices: honor the request, so the table is for a while potentially over-full, or ignore it. ============= here is the header file you are supposed to use, augmented with some tests that one might explicitly make if one were diligent, or if one were the instructor writing an automatic grading program... Array(int n = 1); // constructor: create a new array of size n>0 with no elements. is initial size 1 for default, n for other? what happens if n <= 0? is initial size == constructed size? is initial count == 0? does it create multiple arrays? int put(const string& s, const string& v); // insert string v at A[s]. Return 0 if there is no memory left, // 1 if there was no previous value at A[s], and 2 if there // already was a value. does it return 1 if previously not there is the value stored does it return 2 if already there is the value updated? const string& get(const string& s); // return value from A[s]; if A[s] is not present, // create it with value "" and return that. does it get things previously stored? does it store something not previously stored? does it work if stored value is "" already? int member(const string& s); // return 1 if A[s] is present, 0 if not (don't create A[s]). int count(); // return number of elements currently in A. int size(); // return current size of hash table. do these work? int adelete(const string& s); // delete element A[s] if it exists and recover memory; // return 1 if it did exist, 0 if not. does it return right value? what if delete it again? ~Array(); // destructor: delete array and all its elements, free its storage. if delete array, do its elements go away? check at end to see if space use seems reasonable int grow(int n); // grow the array to size n. Return the new array size, // or 0 if there isn't enough room to grow. The array must // grow by a factor of 2 exactly when adding a new element would // cause count() > size(); count() <= size() at all times compare sizes as elems are added check growing independent of adding what if n < count? no exec code in header file no exit, abort, printf, malloc, free compiles without problems, links with tester.o not too big no core dumps