[Tutor] Binary search question

Robert Berman bermanrl at cfl.rr.com
Sat Apr 24 00:59:55 CEST 2010

> -----Original Message-----
> From: tutor-bounces+bermanrl=cfl.rr.com at python.org [mailto:tutor-
> bounces+bermanrl=cfl.rr.com at python.org] On Behalf Of Hugo Arts
> Sent: Friday, April 23, 2010 5:55 PM
> To: Emile van Sebille
> Cc: tutor at python.org
> Subject: Re: [Tutor] Binary search question
>>>>>>>>>>>>>>>>>BIG SNIP	

> Of course, profiling will immediately catch that kind of performance
> bottleneck. So even if you care about performance, you can start off
> using 'in' and easily optimize later with bisect or a set, the whole
> "don't do it yet" thing and all.
> Hugo

This sounds very much like the school of thought that equates optimal
efficiency with the developers level of comfort < not confidence>. So that I
might be willing to live with an occasional 7 second search time for the
general ease of using <value> in list. Knowing of course that eventually a
programmer who is concerned with that potential 7 second lag time will opt for
either a dictionary lookup or a bisected search.

Robert Berman

What you don't see with your eyes, don't invent with your mouth.

> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list