matching strings in a large set of strings
News123
news1234 at free.fr
Sat May 1 17:46:33 EDT 2010
Dennis Lee Bieber wrote:
> On Sat, 01 May 2010 13:48:02 +0200, News123 <news1234 at free.fr> declaimed
> the following in gmane.comp.python.general:
>
>> Dennis Lee Bieber wrote:
>>> That lets you do a binary search on the file. Much faster than a
>>> linear search (linear search will average out to 41.5M read operations;
>>> binary should be around 10000 reads)
>> Don't you meant 27 reads instead of 41.5 M reads?
>>
> Don't you mean my 10000 reads? The 41.5M is the average for the
> linear search.
>
Indeed, this is what I meant. or phrased differently:
"about 27 reads with a binary search instead of 41.5M reads average with
a linear search."
>>>>> from math import log
>>>>> log(83e6)/log(2)
>> 26.306608000671101
> Probably -- it was late at night and I was working things out in my
> head...
I know about late nights. I just wondered whether I overlooked something.
More information about the Python-list
mailing list