Is there anything better than a Trie for this situation?
- Storing a list of ~100k English words
- Needs to use minimal memory
- Lookups need to be reasonable, but don't have to be lightning fast
I'm working with Java, so my first attempt was to just use a Set<String>. However, I'm targeting a mobile device and already running low on memory. Since many English words share common prefixes, a trie seems like a decent bet to save some memory -- anyone know some other good options?
EDIT - More info - The data structure will be used for two operations
- Answering: Is some word XYZ in the list?
- Generating the neighborhood of words around XYZ with one letter different
Thanks for the good suggestions