@@ -69,10 +69,10 @@ void zfree_hash_table(struct ZHashTable *hash_table);
69
69
// set key to val (if there is already a value, overwrite it)
70
70
void zhash_set(struct ZHashTable * hash_table, char * key, void * val);
71
71
72
- // get the value stored at key (if no value, then return NULL)
72
+ // get the value stored at key (if no value, return NULL)
73
73
void * zhash_get(struct ZHashTable * hash_table, char * key);
74
74
75
- // delete the entry stored at key and return the value
75
+ // delete entry stored at key and return the value (if no value, return NULL)
76
76
void * zhash_delete(struct ZHashTable * hash_table, char * key);
77
77
78
78
// return true if there is a value stored at the key and false otherwise
@@ -110,7 +110,7 @@ int main ()
110
110
for (iterator = zcreate_iterator(hash_table);
111
111
ziterator_exists(iterator); ziterator_next(iterator)) {
112
112
113
- printf("%s %s\n", (char *) ziterator_get_key(iterator),
113
+ printf("%s %s\n", ziterator_get_key(iterator),
114
114
(char *) ziterator_get_val(iterator));
115
115
}
116
116
@@ -132,7 +132,7 @@ void *zsorted_hash_get(struct ZSortedHashTable *hash_table, char *key);
132
132
void * zsorted_hash_delete(struct ZSortedHashTable * hash_table, char * key);
133
133
bool zsorted_hash_exists(struct ZSortedHashTable * hash_table, char * key);
134
134
135
- // create iterator to be used in iteration functions below
135
+ // create an iterator to be used in iteration functions below
136
136
struct ZIterator * zcreate_iterator(struct ZSortedHashTable * hash_table);
137
137
138
138
// free iterator
0 commit comments