I have implemented a trie whose leaf nodes branch off into linked lists that contain possible word endings, because I wanted to see if this would take less time to load.

It does take less time to load, and works best with a 5 - 8 level trie, depending on the size of the text being checked.

My problem has to do with valgrind.

When my dictionary is the single character 'a', my program should be allocating a root node and node pointed to by the first pointer in array lettersAndApos in the root.

Valgrind says I allocate 4 times and free 3 times. I don't know where my mistake is.

Works now. Thanks.

Code omitted to comply with academic honesty code

1 Answer 1


I couldn't find where you closed the file you opened here:

FILE* dictionaryFile = fopen(dictionary, "r");

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .