From 144794c059e0b6fe64858cb304bfab3b475b9ba3 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Mon, 29 Apr 2024 05:22:25 +0000 Subject: Sun, Apr 28, 2024, 10:22 PM -07:00 --- wk5/pset/speller/dictionary.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'wk5/pset') diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c index 96c3e80..36bf274 100644 --- a/wk5/pset/speller/dictionary.c +++ b/wk5/pset/speller/dictionary.c @@ -1,12 +1,12 @@ // Implements a dictionary's functionality +#include "dictionary.h" #include #include #include #include #include #include -#include "dictionary.h" // Represents a node in a hash table typedef struct node @@ -55,7 +55,8 @@ unsigned int hash(const char *word) bool load(const char *dictionary) { // initialize the table - for (int i = 0; i < N; i++) { + for (int i = 0; i < N; i++) + { // malloc size of next table[i] = NULL; } @@ -67,11 +68,11 @@ bool load(const char *dictionary) return false; } - //read each word in dictionary + // read each word in dictionary char word[LENGTH + 1]; // use fscanf(file, "%s", word) to grab words // check for ended file - while(fscanf(source, "%s", word) == 1) + while (fscanf(source, "%s", word) == 1) { // update size int siz++; @@ -103,7 +104,6 @@ bool load(const char *dictionary) ptr->next = table[val]; table[val] = ptr; } - } // Close the dictionary file -- cgit v1.2.3