I'm having some trouble in implementing load()
.
I thought I should make a trie, but could not understand how to.
Then I thought I'd make a hash table, but I had no idea how to.
The only way I can think of is counting the words in the dictionary
and create an array[word count], then with a for loop
and fscanf()
fill in the array with strings from the dictionary
. I was thinking I could access the values with a sorting algorithm.
But I know this is not how I'm supposed to complete the assignment because all the lectures, sections, and shorts were about other data structures, but I'm lost and I don't know where to start from. I understand the concept of tries, hashing, and trees, but when it comes to the implementation I feel helpless.
I looked at https://study.cs50.net/, but other than very little pseudocode and theoretical explanations there's nothing about the actual implementation of these kinds of data structures.
Any help or resource would be of great help, I don't want to just look up the solutions on GitHub, I would like to understand it on my own.