summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 22:30:24 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 22:30:24 +0000
commit36a46d1a7f08e24fc4dedc6cc08d7a6957b4b111 (patch)
tree31796d5436f370ca214a514edb2123c88341d067
parentf035bf48b1ed43222a13509e8b4016060f1c9955 (diff)
Sun, Apr 28, 2024, 3:30 PM -07:00
-rw-r--r--wk5/pset/speller/dictionary.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index 342f843..527abff 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -67,15 +67,16 @@ bool load(const char *dictionary)
}
// copy word from fscanf into node using strcpy
strcpy(ptr->word, word);
- hash(word);
- ptr->next =
+ ptr->next = NULL;
+ int val = hash(word);
+
}
/*
use hash function
function takes string and returns index
insert node into hash table
- HOW
+ for whatever hash index, go to end and put it there
*/
// Close the dictionary file