Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sort ¶
Sort partially sorts a slice of any ordered type in ascending order. Only elements in x[:k] will be in sorted order. This is faster than using slices.Sort when k is small relative to the number of elements.
func SortFunc ¶
SortFunc partially sorts the slice x in ascending order as determined by the less function. Only elements in x[:k] will be in sorted order. This is faster than using slices.SortFunc when k is small relative to the number of elements.
func TopK ¶
TopK reorders a slice such that x[:k] contains the first k elements of the slice when sorted in ascending order. Only the kth element x[k-1] is guaranteed to be in sorted order. All elements in x[:k-1] are less than or equal to the kth element, all elements in x[k:] are greater than or equal. This is faster than using slices.Sort.
func TopKFunc ¶
TopKFunc reorders a slice such that x[:k] contains the first k elements of the slice when sorted in ascending order as determined by the less function. Only the kth element x[k-1] is guaranteed to be in sorted order. All elements in x[:k-1] are less than or equal to the kth element, all elements in x[k:] are greater than or equal. This is faster than using slices.SortFunc.
Types ¶
This section is empty.