sort

fun sort(array: IntArray)(source)
fun <T> sort(list: MutableList<T>, key: (T) -> Int): MutableList<T>(source)


fun <T> sort(array: Array<T>, key: (T) -> Int): Array<T>(source)

Generic overload for any type mappable to an Int key. The key lambda extracts the integer rank used for bucketing.

Example:

PigeonholeSort.sort(people) { it.age }