Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I thought it was widely known, IIRC a number of languages have adopted it as the stdlib default sorting algorithm for either unstable/stable sort (can't remember which is it?)

I'm not big into algorithms but I believe that pdqsort and timsort were supposed to be the best two general sorts.



Java uses it in Arrays.sort:

     * <p>The implementation was adapted from Tim Peters's list sort for Python
     * (<a href="http://svn.python.org/projects/python/trunk/Objects/listsort.txt">
     * TimSort</a>).  It uses techniques from Peter McIlroy's "Optimistic
     * Sorting and Information Theoretic Complexity", in Proceedings of the
     * Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474,
     * January 1993.


> either unstable/stable sort (can't remember which is it?)

Stable. It’s a hybrid mergesort.

Some of the langages which adopted it after Python are Java, Rust, or Swift.


Java and Python IIRC




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: