Right,

but getting the huge thing in the right format, storing that
statically, etc.., vs preloading the app with a database, which sounds
easier?  I just think the database sounds like the better way to go on
this one, and I'm biased to not reinventing the wheel, but the OP is
obviously free to use whatever..

kris

On Tue, Dec 20, 2011 at 2:11 AM, Christopher Van Kirk
<christopher.vank...@gmail.com> wrote:
> Then again a Trie isn't really that hard to write.
>
> On 12/20/2011 3:08 PM, Kristopher Micinski wrote:
>> Right,
>>
>> But it does have the advantage that the technology on Android is
>> already there, so he doesn't have to write the implementation himself,
>> or grab one and learn to use it off the web.
>>
>> kris
>>
>> 2011/12/20 Christopher Van Kirk <christopher.vank...@gmail.com>:
>>> A conventional database isn't going to do better than a Trie, I think.
>>>
>>> On 12/20/2011 2:46 PM, felix wrote:
>>>> Thanks a lot! I think I'll give database a try!:)
>>>>
>>>> On 12月20日, 下午1时49分, Kristopher Micinski <krismicin...@gmail.com>
>>>> wrote:
>>>>> OH!  Very sorry!  I didn't see the 500, thousand!!!
>>>>>
>>>>> Kris
>>>>>
>>>>> On Tue, Dec 20, 2011 at 12:49 AM, Kristopher Micinski
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> <krismicin...@gmail.com> wrote:
>>>>>>  Ah, what a classic question in computer science :-)
>>>>>> To really get the answer to this question, you're going to have to
>>>>>> learn a little bit about data structures.  Wait... How is it taking
>>>>>> you *20 seconds* to find the word!?  That's absurd!  Really?  You're
>>>>>> doing string comparisons over 500 strings and it's taking you 20
>>>>>> seconds!?
>>>>>> Anyway, there are two solutions, you might just try using a database,
>>>>>> (not a bad idea, actually), or you might use a hash table (lookup
>>>>>> "HashTable"), if you want to check for bogus words before searching
>>>>>> (okay so this is a bit of a stretch and probably not useful but I
>>>>>> think it deserves a mention) you can look at using a bloom filter...
>>>>>> Obviously there are tons of other data structures you can use too.
>>>>>> Kris
>>>>>> P.s., (did I mention that you should probably be using a database, as,
>>>>>> for Android, it's probably going the best acceptable solution that is
>>>>>> fairly extensible.  I'm sure somebody might bring up the possible
>>>>>> badness of having it out on the SD card somewhere, but even this isn't
>>>>>> so bad, especially compared to 20 seconds!)
>>>>>> On Tue, Dec 20, 2011 at 12:26 AM, felix <guofuchu...@gmail.com> 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?
>>>>>>> Thanks to all!
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Android Developers" group.
>>>>>>> To post to this group, send email to android-developers@googlegroups.com
>>>>>>> To unsubscribe from this group, send email to
>>>>>>> android-developers+unsubscr...@googlegroups.com
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/group/android-developers?hl=en
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-developers+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to