Import with #import "std/sort".

Sort :: (values: []$T)

Sorts values in ascending order.

IsSorted :: (values: []$T) -> bool

Reports whether values are in ascending order.

LowerBound :: (values: []$T, target: T) -> s64

Returns the first index whose value is not less than target, or values.count when every value is less. values must be sorted.

BinarySearch :: (values: []$T, target: T) -> s64

Returns an index holding target, or -1 when values has none. values must be sorted.

SortText :: (values: []string)

Source ↗ · All modules