timSort

fun <T> timSort(a: Array<T>, fromIndex: Int, toIndex: Int, comp: Comparator<in T>)

Sorts the given array slice using the Comparator. This method uses the Tim sort algorithm, but falls back to binary sort for small arrays.

Parameters

fromIndex

start index (inclusive)

toIndex

end index (exclusive)

See also


fun <T> timSort(a: Array<T>, comp: Comparator<in T>)

Sorts the given array using the Comparator. This method uses the Tim sort algorithm, but falls back to binary sort for small arrays.

See also


fun <T : Comparable<T>> timSort(a: Array<T>, fromIndex: Int, toIndex: Int)

Sorts the given array slice in natural order. This method uses the Tim sort algorithm, but falls back to binary sort for small arrays.

Parameters

fromIndex

start index (inclusive)

toIndex

end index (exclusive)

See also


fun <T : Comparable<T>> timSort(a: Array<T>)

Sorts the given array in natural order. This method uses the Tim sort algorithm, but falls back to binary sort for small arrays.

See also