[Tutor] List comprehensions to search a list--amazing!

Dave Angel davea at davea.name
Tue Mar 24 03:20:54 CET 2015


On 03/23/2015 10:17 PM, Dave Angel wrote:
> On 03/23/2015 09:42 PM, boB Stepp wrote:


> Not really.  See Steve's

OOPS.  Peter's

 > response for some numbers. If I had to guess,
> I'd say that for lists over 100 items, you should use bisect or
> equivalent.  But I'd also say you should have one algorithm in your
> final code, even if it's sub-optimal for tiny lists.  If even a fraction
> of the searches are going to be on a list of 10k items, you should
> switch to a bisect approach.
>


-- 
DaveA


More information about the Tutor mailing list