countingSort

inline fun <T : IntSupplier> countingSort(input: Array<T>, k: Int): Array<T>(source)

Sorts input using counting sort into a new array and returns it. The input array will not be changed.

Parameters

input

The array to sort by IntSupplier.getAsInt

k

The maximum value returned by IntSupplier.getAsInt