+ 2
What should i use?
So i want to find specific words in alot of files(.txt) which have 1 word per line and are alphabetically ordered. Im thinking of using a array with 26 and then in each position making a LinkedList<String> to store all the words and then look for the ones i need, but i guess this isn't the best way if the files are too big! So what do you guys think? Should i just read the files over and over again without storing anything?
2 Answers
0
26 position array because 26 letters in the alphabet so when im looking for a word i can use arr[word.charAt(0)-'a'] and then i'll just compare with the words in the linkedlist