In article <[EMAIL PROTECTED]>,
Dan Stromberg  <[EMAIL PROTECTED]> wrote:
>
>Python appears to have a good sort method, but when sorting array
>elements that are very large, and hence have very expensive compares,
>is there some sort of already-available sort function that will merge
>like elements into a chain, so that they won't have to be recompared as
>many times?

I'll just note that Python's sort is specifically designed to reduce the
number of compares precisely because *all* compares in Python are
relatively expensive.  I'll suggest a variant on the previous suggestion
of hash:

[a] -> [hash(a), index(a), a]
-- 
Aahz ([EMAIL PROTECTED])           <*>         http://www.pythoncraft.com/

"Don't listen to schmucks on USENET when making legal decisions.  Hire
yourself a competent schmuck."  --USENET schmuck (aka Robert Kern)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to