From eff41ddbeee88c65872923423276042dc5604529 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Mon, 29 Apr 2024 02:42:14 +0000 Subject: Sun, Apr 28, 2024, 7:42 PM -07:00 --- wk5/pset/speller/dictionary.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'wk5') diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c index f479021..b23275a 100644 --- a/wk5/pset/speller/dictionary.c +++ b/wk5/pset/speller/dictionary.c @@ -27,13 +27,14 @@ int siz = 0; bool check(const char *word) { // hash word to find bucket - node *current = table[hash(word)]; + int val = hash(word); + node *current = table[val]; // check all nodes in the bucket while (current != NULL) { // check if this is the word - if (current->word == word) + if (current->word word) { return true; } -- cgit v1.2.3