Re: [Boston.pm] binary search on a list of sorted strings in memory

2009-07-09 Thread Steve Tolkin
I tried to explain in the O.P. It is search based on matching the string prefix, and so is not exact search. I have a large set of target strings, about 250,000. I have a set of search strings, about 7,500. Assume both arrays are sorted. In pseudo-code (pseudo-perl): S: for each $s in

[Boston.pm] Binary search requirements + estimates (not empty)

2009-07-09 Thread Ricker, William
Are the prefix uniform size? Or can a small number of expected matchable prefixes be parsed out of the 250k strings? Are you doing this once, or new set of 7500 perefixes every minute? Are both lists already sorted? If big one isn't that dominates. If big one is but not according to primitive

Re: [Boston.pm] binary search on a list of sorted strings in memory

2009-07-09 Thread Ronald J Kimball
On Wed, Jul 08, 2009 at 08:33:34PM -0400, Steve Tolkin wrote: I want to search a sorted array to see if which strings, if any, have the same prefix as my search string. For example, given the search string of tempest I want to find tempests and tempestuous. My word list has about 250,000

Re: [Boston.pm] binary search on a list of sorted strings in memory

2009-07-09 Thread Shlomi Fish
On Thursday 09 July 2009 17:17:40 Ronald J Kimball wrote: On Wed, Jul 08, 2009 at 08:33:34PM -0400, Steve Tolkin wrote: I want to search a sorted array to see if which strings, if any, have the same prefix as my search string. For example, given the search string of tempest I want to find

Re: [Boston.pm] binary search on a list of sorted strings in memory

2009-07-09 Thread Palit, Nilanjan
-Original Message- From: Ronald J Kimball Sent: Thursday, July 09, 2009 10:18 AM Subject: Re: [Boston.pm] binary search on a list of sorted strings in memory Another option would be a dictionary tree, in which each node is a single letter, so each word is represented by a path through

Re: [Boston.pm] binary search on a list of sorted strings in memory

2009-07-09 Thread Bernardo Rechea
On Thursday 09 July 2009 10:17:40 Ronald J Kimball wrote: On Wed, Jul 08, 2009 at 08:33:34PM -0400, Steve Tolkin wrote: I want to search a sorted array to see if which strings, if any, have the same prefix as my search string. For example, given the search string of tempest I want to find