The OpenD Programming Language

quickSelect

Returns the kth largest/smallest element (depending on compFun, 0-indexed) * in the input array in O(N) time. Allocates memory, does not modify input * array.

T
quickSelect
(
alias compFun = "a < b"
T
)
(
T[] data
,
sizediff_t k
)

Meta