I am building an Android application, which loads a large dictionary into memory, such that remaining RAM is very limited.
I need to reference a second large word-list, but don't have the space to load it into RAM.
Since the "disk" on an Android device is actually also RAM, would it be practical to quickly search my second list without first loading it into memory?
I was thinking of some sort of disk-based divide-and-conquer algorithm.
For instance, I could format the 2nd list alphabetically with fixed-size fields,
- seek to the middle of the file, and grab that word
- determine if my word is in the first-half or second half
- recurse until I find my word (or don't)
But I don't know what the performance of doing it this way would be. And I can't seem to find anything documented on the web about searching files this way.
Perhaps I am simply searching for the wrong terms.
If anybody can point me to a tutorial on filesystem-based seeking in java (android) I would appreciate it!