BlockSort

Block Sort (Wiki Sort).

A merge-based sorting algorithm that achieves O(n log n) time with O(1) auxiliary space. Works by dividing the array into blocks, sorting them, then merging using internal buffers.

Time complexity: O(n log n) worst case Space complexity: O(1) auxiliary space (in-place)

Functions

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