It takes advantage of existing structure in a list, allowing it to perform n-1 comparisons on a list which is already in order or in strictly-descending (reverse) order. To do this, TimSort walks the list, finding "runs" of elements already in ascending order or in strictly descending order, a "run." If the run is in strictly descending order, TimSort reverses it in place (hence why the run must be strictly descending, as this operation would otherwise not maintain TimSort's stability). Then, if the run is less than a chosen "minrun" size, TimSort uses InsertionSort to bulk it up to minrun elements. The value of minrun is calculated such that, where n is the size of an array, n/minrun is a power of two or slightly less than a power of two, thus ensuring balanced merges on random data.