On Mon, Mar 08, 2021 at 04:59:26PM +0900, Stephen J. Turnbull wrote:

> I'm curious: Many of the sorting algorithms I know use swap pairs of
> elements, but what sorting algorithm reverses segments longer than 3?

I have a feeling that Timsort may do that --- I believe it looks for 
either ascending or descending runs, sorts them, and reverses them if 
necessary.

Of course I may be wrong.


-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/DBGL775O5DZ3QU57TO3R4YDS4SLX7FRW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to