/* File: dict.c This implements a dictionary as a linked list. */ #include "dict.h" #define WordSize 35 //The max size of each word in the dictionary typedef struct entry { //An entry consists of the word, its associated char word[WordSize]; //integer value, and a pointer to the next entry. int value; struct entry *next; } entry; typedef struct { //A dictionary is a linked list of entries. entry *head; int numEntries; } dictionary; static dictionary *dict; //Global variable to represent the dictionary. //Simplifies use of the dictionary for the users //because they don't have to know anything about //how the dictionary is implemented. /* This function initializes the dictionary to be empty and must be called before any of the other operations are used. */ void InitDictionary(void) { } /* This function associates the word with its subversiveness rating. Any previous definition for the word is lost. If defining the word would exceed the capacity of the dictionary, an error is generated. */ void Define(char *word, int score) { } /* This function looks up the word in the dictionary and returns its assoicated integer value. If the word has not been defined, this function returns -1. */ int Lookup(char *word) { } /* This function prints the contents of the dictionary. */ void PrintDictionary() { }