From 6ff784158f61a082fe6d4332c743a066ef007674 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Thu, 22 Oct 2020 07:50:12 -0500 Subject: Add Project 2 Files --- P2/include/reducer.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 P2/include/reducer.h (limited to 'P2/include/reducer.h') diff --git a/P2/include/reducer.h b/P2/include/reducer.h new file mode 100644 index 0000000..44afe2a --- /dev/null +++ b/P2/include/reducer.h @@ -0,0 +1,27 @@ +#ifndef REDUCER_H +#define REDUCER_H + +#include "utils.h" + +#define MAXKEYSZ 50 + +// ###### DO NOT REMOVE ###### +typedef struct finalKeyValueDS { + char key[MAXKEYSZ]; + int value; + struct finalKeyValueDS *next; +} finalKeyValueDS; + +finalKeyValueDS *finalDS = NULL; + +// ###### DO NOT REMOVE ###### +finalKeyValueDS *createFinalKeyValueNode(char *value, int count); +finalKeyValueDS *insertNewKeyValue(finalKeyValueDS *root, char *word, int count); +void freeFinalDS(finalKeyValueDS *root); + +// ###### DO NOT REMOVE ###### +void writeFinalDS(int reducerID); +void reduce(char *key); + +#endif + -- cgit v1.2.3