I'm wondering what the best implementation would be for a game that makes continuous checks if a given user word is in dictionary. The dictionary itself has ~220,000 words.
I'm looking for a solution that uses minimal available resources for if possible a way to reduce the size of the dictionary (right now its a .txt file ~1.2Mb large)
My current solution is to have 26 seperate files (beginning a-z) and load these each into an array (which will at max hold a size of about ~15,000 strings).
A second idea would be to use a trie-tree structure rather than array.
A database seems like it would take up far too much space.
Edit: I also need to be able to check if there are any words that begin with those letters available in the dictionary.
Ex. word is sea. Yes it is in the dictionary, and yes there are other words that begin with sea.
Ex 2. word is pov. No it is not in the dictionary, yes there are other words that begin with pov