Package-level declarations
Functions
Link copied to clipboard
Median of three finds the pivot by taking the median of the first, middle and last element.
Link copied to clipboard
fun <T : Comparable<T>> MutableList<T>.partitionDutchFlag(low: Int, high: Int, pivotIndex: Int): Pair<Int, Int>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Inventor: Tony Hoare Worst complexity: n^2 Average complexity: nlog(n) Best complexity: nlog(n) Method: Partitioning Stable: No
Link copied to clipboard
Dutch national flag partitioning strategy helps to organize duplicate elements in a more efficient way.
Link copied to clipboard
Hoare’s partitioning chooses the first element as its pivot.
Link copied to clipboard
Link copied to clipboard
Lomuto’s partitioning chooses the last element as the pivot.
Link copied to clipboard
Link copied to clipboard
The naive partitioning creates a new list on every filter function; this is inefficient.