BinaryInsertionSort

Binary Insertion Sort.

Uses binary search to find the insertion position, reducing comparisons compared to normal insertion sort.

Functions

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

Sorts the array in ascending natural order.

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