summaryrefslogtreecommitdiff
path: root/wk5/pset/speller
diff options
context:
space:
mode:
Diffstat (limited to 'wk5/pset/speller')
-rw-r--r--wk5/pset/speller/dictionary.c10
1 files 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