So, I was learning Data Structures in Java on my own. And there was a "challenge question" in the book. The question basically asked me to make a data structure that could store all the words in a novel, and then it would associate with the word, where it occurs (like line number and character count) and the frequency of the amount of times it occurs. I was wondering which data structure should I use to store all this while maintaining a relatively Fast look up time and such.
I was thinking either hashmaps or tries, but I don't know which trie to use and how to associate the frequency of the word and stuff
Thanks in advance!