Questions tagged [trie]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
347 views

pset5:(speller) Check function does not correctly identify misspelled words

/** * Implements a dictionary's functionality. */ #include <stdbool.h> #include "dictionary.h" #include<string.h> #include <stdio.h> #include <stdlib.h> #include<ctype.h&...
5
votes
1answer
967 views

Pset5: Misunderstanding tries and method to assign letter to an array inside a struct

Before posting, I've searched a lot here and there on the Internet to find the answers to my questions myself and I did code something that eventually works. My issue is that I've re-rewrote some ...
0
votes
1answer
3k views

Speller Unload Trie with Recursion

node* root; bool unload(void) { freenodes(root); return true; } freenodes function(node* path) { loop over all nodes { if node is not null (path -> children[i]) ...
1
vote
1answer
218 views

pset5 load function segfault do not show in gdb

I cannot figure what's wrong with the code, it gives me a segfault, but runs in valgrind and in gdb. So far, i only wrote the load function, so anything else is still empty. #include <stdbool....
0
votes
1answer
171 views

Pset5: Check returns all as misspelled (trie)

I can't, for the life of me, figure out why my check function doesn't work properly. I have triple-checked my load() every way I know how and believe the data structure is properly setup. Why doesn't ...
0
votes
1answer
105 views

Stuck on the unload() function. Possibly wrong logic used on load() and check() using tries

I am using tries to complete the spellcheck but I just can't keep up with the logic. I've implemented load() and check() as much as I could but I'm sure it has some logic flaw. The unload() function ...
0
votes
1answer
168 views

Memory leaks in Speller

My program passes all tests except the valgrind check. I tried to find the cause of errors, but valgrind is too 'obscure' for me yet, I don't know what to do. I guess some memory isn't freed, but I ...
0
votes
1answer
743 views

Pset5 trie problem with load: persisting segmentation fault

I read lot of questions and answers about the "load"segmentation errors in pset5 but I still experience some difficulties fixing it. I tried to make sure there are no garbage values by initializing ...
0
votes
1answer
285 views

Segfault when implementing trie in pset5

I'm trying to implement a trie as my load function in pset5, but I have two questions: How did I fix the segfault I encounter? (identified specifically below) More broadly, where are the errors in my ...