SliceOnComparableSliceExtension<T extends Comparable<T>> extension

on

Methods

binarySearch(T x) Result<int, int>

Available on Slice<T>, provided by the SliceOnComparableSliceExtension extension

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.
isSorted() bool

Available on Slice<T>, provided by the SliceOnComparableSliceExtension extension

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>)

Available on Slice<T>, provided by the SliceOnComparableSliceExtension extension

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

Available on Slice<T>, provided by the SliceOnComparableSliceExtension extension

Sorts the slice, but might not preserve the order of equal elements.