BucketSort

Bucket Sort.

Distributes elements into buckets, sorts each bucket, then concatenates them into the final sorted array.

Functions

Link copied to clipboard
fun <T : Comparable<T>> sort(array: Array<T>)

Sorts the array in ascending natural order.

fun sort(array: IntArray)

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

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

Sorts the array using the given comparator.