Tim Peters <t...@python.org> added the comment:

"Galloping" is the heart & soul of Python's sorting algorithm.  It's explained 
in detail here:

https://github.com/python/cpython/blob/master/Objects/listsort.txt

The Java fork of the sorting code has had repeated bugs due to reducing the 
size of "the stack" used to hold merge states.  Read the papers already 
referenced for details about that.

There is no "bug" here in the Python version.  It's that the complex code Java 
keeps tripping over ;-) , _could_ (possibly) be replaced by simpler code where 
the max stack size needed is obvious; that (e.g.) 2-merge moves around less 
memory overall in some cases where the current scheme is particularly wasteful 
in this respect; and that Munro & Wild present more ambitious merge-ordering 
schemes that are said to be provably near-optimal in a broader sense than 
2-merge achieves.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34561>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to