sort

fun sort(array: IntArray, type: SortType)(source)

Sorts array in ascending order using the given type.

Parameters

array

array to sort

type

sorting algorithm to use


fun <T : Comparable<T>> sort(array: Array<T>, type: SortType)(source)

Sorts array in ascending natural order using the given type.

Parameters

array

array to sort

type

sorting algorithm to use


fun <T> sort(array: Array<T>, type: SortType, comparator: Comparator<T>)(source)

Sorts array using the given comparator and type.

Parameters

array

array to sort

type

sorting algorithm to use

comparator

comparator to determine order