introSort

fun <T> introSort(list: MutableList<T>, comp: Comparator<T>)

Sorts the given random access List using the Comparator. The list must implement RandomAccess. This method uses the intro sort algorithm, but falls back to insertion sort for small lists.

See also

Throws

if list is e.g. a linked list without random access.


fun <T : Comparable<T>> introSort(list: MutableList<T>)

Sorts the given random access List in natural order. The list must implement [ ]. This method uses the intro sort algorithm, but falls back to insertion sort for small lists.

See also

Throws

if list is e.g. a linked list without random access.