From 5a3bcf547b7766220bb819cccee80416c87e3e2d Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Sun, 28 Apr 2024 23:39:08 +0000 Subject: Sun, Apr 28, 2024, 4:39 PM -07:00 --- wk5/pset/speller/dictionary.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c index 2cd5256..19be3d6 100644 --- a/wk5/pset/speller/dictionary.c +++ b/wk5/pset/speller/dictionary.c @@ -26,7 +26,7 @@ int size = 0; bool check(const char *word) { // hash word to find bucket - node *current = table(hash(word)); + node *current = table[hash(word)]; // check all nodes in the bucket while (current != NULL) @@ -89,11 +89,11 @@ bool load(const char *dictionary) // hash the word to find the bucket it goes in int val = hash(word); // put new node at begining of bucket - if (table(val)->next != NULL) + if (table[val]->next != NULL) { - ptr->next = table(val)->next; + ptr->next = table[val]->next; } - table(val)->next = *ptr; + table[val]->next = *ptr; } // Close the dictionary file @@ -114,7 +114,7 @@ bool unload(void) for (int i = 0; i < N; i++) { // while there's more in the bucket - node *current = table; + node *current = table[i]; while (current != NULL) { // record position of this node -- cgit v1.2.3