diff options
author | Andrea Smith <smit9523@umn.edu> | 2020-10-05 20:47:49 -0500 |
---|---|---|
committer | Andrea Smith <smit9523@umn.edu> | 2020-10-05 20:47:49 -0500 |
commit | 5c11a1ee292f9d51d697910a95a2a93884ff8d0f (patch) | |
tree | f750cd77d6c16bc867db924aaf188eace28726a7 /P1/src | |
parent | Merge branch 'master' of github.umn.edu:STRAP012/csci4061Projects (diff) | |
download | csci4061-5c11a1ee292f9d51d697910a95a2a93884ff8d0f.tar csci4061-5c11a1ee292f9d51d697910a95a2a93884ff8d0f.tar.gz csci4061-5c11a1ee292f9d51d697910a95a2a93884ff8d0f.tar.bz2 csci4061-5c11a1ee292f9d51d697910a95a2a93884ff8d0f.tar.lz csci4061-5c11a1ee292f9d51d697910a95a2a93884ff8d0f.tar.xz csci4061-5c11a1ee292f9d51d697910a95a2a93884ff8d0f.tar.zst csci4061-5c11a1ee292f9d51d697910a95a2a93884ff8d0f.zip |
Comments
Diffstat (limited to '')
-rw-r--r-- | P1/src/reducer.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/P1/src/reducer.c b/P1/src/reducer.c index 9519fa3..cf91e31 100644 --- a/P1/src/reducer.c +++ b/P1/src/reducer.c @@ -45,6 +45,10 @@ void freeFinalDS(finalKeyValueDS *root) { // reduce function void reduce(char *key) { + // Calculate the total count of values (1's) for the word from [the_word].txt + // Store the total count in finalKeyValueDS + // Lather, rinse, repeat for all the words + } @@ -60,11 +64,11 @@ void writeFinalDS(int reducerID){ char filename[BUFFSIZE] = ""; sprintf(filename, "output/ReduceOut/Reduce_%d.txt", reducerID); FILE* fptr = fopen(filename, "w"); - fprintf(fptr, "%s %s", tempNode -> key, tempNode -> value); + fprintf(fptr, "%s %d", tempNode -> key, tempNode -> value); fclose(fptr); tempNode = tempNode -> next; } - freeInterDS(root -> next); + freeFinalDS(root -> next); } int main(int argc, char *argv[]) { |