On Mon, Dec 19, 2011 at 09:26:11PM -0800, felix wrote: > Hi! > I'm working on a dict app on android, > I need to search a list of words(about 500-600 thousand words) in file > to find the word. > It took me about 10-20 seconds to search the word. How can I improve > the search speed?
Well, along with Kris's solutions, here's another (that you could use with his, or on its own if it's enough): Use whatever works best for you (regexp or simply grabbing the first char directly from the string) and get the first character (or first two, or ... and so on) and split your data accordingly. That way, instead of searching through the WHOLE LIST for zulu, you'd only search words starting with 'z' (or "zu", etc.). It would no doubt work better combined with Kris's ideas. Later, --jim -- THE SCORE: ME: 2 CANCER: 0 73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 > [email protected] ICBM/Hurricane: 30.44406N 86.59909W "'Wrong' is one of those concepts that depends on witnesses." --Catbert: Evil Director of Human Resources (Dilbert, 05Nov09) Android Apps Listing at http://www.jstrack.org/barcodes.html -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

