sort

open override fun sort(from: Int, to: Int)

Sort the slice which starts at from (inclusive) and ends at to (exclusive).


fun sort(from: Int, to: Int, maxDepth: Int)

Sorts between from (inclusive) and to (exclusive) with intro sort.

Sorts small ranges with insertion sort. Fallbacks to heap sort to avoid quadratic worst case. Selects the pivot with medians and partitions with the Bentley-McIlroy fast 3-ways algorithm (Engineering a Sort Function, Bentley-McIlroy).