AlgorithmsSortingEdit on GitHubEdit history
Timsort
2002
An adaptive stable sort that finds already sorted segments (runs) in the input, extends them with binary insertion sort, and combines them with galloping merges.
Origin
Lineage
Parent algorithms
Author statementlistsort.txt describes run-based merging and galloping merges as its core — github.com/python/cpython/blob/main/Objects/listsort.txt
Author statementlistsort.txt describes extending short runs to the minimum length with binary insertion sort — github.com/python/cpython/blob/main/Objects/listsort.txt
Derived algorithms
Author statementCPython's listsort.txt records that Timsort's merge-ordering strategy was replaced by the powersort strategy of Munro and Wild. — github.com/python/cpython/blob/main/Objects/listsort.txt
Notable implementations
- python/cpython/Objects/listobject.cC
- openjdk/jdk/src/java.base/share/classes/java/util/TimSort.javaJava
- v8/v8/third_party/v8/builtins/array-sort.tqTorque
Find more: GitHub · Semantic Scholar · Google Scholar · arXiv
Claims & disputes
Loading…