SliceOnComparableSliceExtension<T extends Comparable<T>> extension

on

Methods

binarySearch(T x) Result<int, int>
Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.
isSorted() bool
Checks if the elements of this slice are sorted. That is, for each element a and its following element b, a <= b must hold.
partitionDedup() → (Slice<T>, Slice<T>)
Moves all consecutive repeated elements to the end of the slice according to Comparable. Returns two slices. The first contains no consecutive repeated elements. The second contains all the duplicates in no specified order. If the slice is sorted, the first returned slice contains no duplicates.
sortUnstable() → void
Sorts the slice, but might not preserve the order of equal elements.