if number is 1-2, 4 or 6-8 or 12-28, 30, 32...

John Machin sjmachin at lexicon.net
Tue Jun 11 16:20:31 EDT 2002


Gustaf Liljegren <gustafl at algonet.se> wrote in message news:<Xns922AD3C74280gustafl at 195.100.94.182>...
> Cliff Wells <logiplexsoftware at earthlink.net> wrote: 
> 
> Thanks both of you. I tried both solutions. Since some intervals are very 
> high (1000000+), it takes too long to add them to a list. Cliff's solution 
> was really fast, but it took a while to understand. :)
> 

Sorry, Mr Customer, I thought I heard you say "thousands & elegant";
now I'm hearing "millions & fast". Let's get serious:

How many intervals do you have (a) max (b) average? How many of the
intervals are single integers? Between the lowest possible number and
the highest possible number, what percentage of integers are in the
set? What is the frequency distribution of membership tests? [I.e. is
it biassed towards small/large integers or is it "random"?] What is
your real speed requirement? With Cliff's solution, what proportion of
your app's run-time is spent testing set membership? How many tests
per set?



More information about the Python-list mailing list