Sorting troubles

Terry Reedy tjreedy at udel.edu
Tue May 15 02:37:47 EDT 2007


<seyensubs at yahoo.com> wrote in message 
news:1179204326.945346.38590 at q75g2000hsh.googlegroups.com...
| Teach said that the optimal threshold in hybrids is 14-16, but guess
| he wasn't so right after all =\\ The overhead of using insertion sort
| on a longer list turns out to be faster than just piling on
| recursions, when confronted with bigger lists.

The current list.sort (is C, of course, not Python) is a hybrid 
insert/merge sort with a threshhold, last I knew, of 64.  I believe there 
are explanatory comments in the source.

tjr






More information about the Python-list mailing list