BogoSort

Bogo Sort.

Randomly shuffles the array until it becomes sorted.

WARNING: Extremely inefficient. Intended only for demonstration/testing.

Functions

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

Sorts the array using Bogo Sort.

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