Comparing strings from the back?

Gelonida N gelonida at gmail.com
Sat Sep 8 11:50:22 EDT 2012


On 09/06/2012 10:33 AM, Steven D'Aprano wrote:
> On Wed, 05 Sep 2012 22:47:14 +0000, Oscar Benjamin wrote:
>
> I may have been overly-conservative earlier when I said that on average
> string equality has to compare half the characters. I thought I had
> remembered that from a computer science textbook, but I can't find that
> reference now, so possibly I was thinking of something else. (String
> searching perhaps?).

Yeah I think you mixed it up with searching an entry in an unsorted list 
of length N


That's one of the most common N/2 cases, that one hits daily with many 
straight forward implementations





More information about the Python-list mailing list