import { quickselect } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";
Rearrange items in arr
so that all items in [left, k]
range are the smallest.
The k
-th element will have the (k - left + 1)
-th smallest value in [left, right]
.
Implements Floyd-Rivest selection algorithm https://en.wikipedia.org/wiki/Floyd-Rivest_algorithm