summaryrefslogtreecommitdiff
path: root/wk5/pset
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 23:29:48 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 23:29:48 +0000
commit7ab9a573550090e6899b3504f07816c49a033fd8 (patch)
tree2d99a580996066c2794bd6d5bc2ca36cf09838d5 /wk5/pset
parentd4a281b86465d594b319537193be95f44f4536cf (diff)
Sun, Apr 28, 2024, 4:29 PM -07:00
Diffstat (limited to 'wk5/pset')
-rw-r--r--wk5/pset/speller/dictionary.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index e088543..c25c02f 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -38,7 +38,7 @@ bool check(const char *word)
// move on to next node
current = current->next;
}
-
+
return false;
}
@@ -109,6 +109,17 @@ unsigned int size(void)
// Unloads dictionary from memory, returning true if successful, else false
bool unload(void)
{
- // TODO
+ // for every bucket
+ for (int i = 0; i < N; i++)
+ {
+ // while there's more in the bucket
+ node *current = table(i);
+ while (current != NULL)
+ {
+ // record position of next node
+ current = current->next;
+ // free this node
+ }
+ }
return false;
}