#ifndef INVERTEDINDEXTREE_H_ #define INVERTEDINDEXTREE_H_ #include #include #include #include "invertedIndex.h" /* * invertedIndexTree is a binary search tree of the following struct, defined * in invertedIndex.h": struct InvertedIndexNode { char *word; // key struct FileListNode *fileList; struct InvertedIndexNode *left; struct InvertedIndexNode *right; }; */ // Returns a newly malloc'ed inverted index node, fields initialised to zero // except for word. struct InvertedIndexNode *createInvertedIndexNode(char *const word); // Inserts to a FileListNode BST. Uses strcmp to determine priority, with // negative values moving into the left and positive values into the right. struct InvertedIndexNode * insertInvertedIndexNode(struct InvertedIndexNode *node, char *const word); // Searches for an invertedIndexNode based off the a word. struct InvertedIndexNode * searchInvertedIndexNode(struct InvertedIndexNode *node, char *const word); // Searches for an invertedIndexNode via a string. struct InvertedIndexNode * searchInvertedIndexNode(struct InvertedIndexNode *head, char *const word); #endif