sort

fun sort(array: IntArray)(source)

Sorts an IntArray using counting-style bucket sort. Requires knowing the max value upfront.

Parameters

array

array to sort


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

Sorts the array in ascending natural order.

Parameters

array

array to sort


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

Sorts the array using the given comparator.

Parameters

array

array to sort

comparator

comparator to determine order