Returns an array of the minimum and maximum element in r. Performs < 3n/2 comparisons, unlike the naive < 2n.
The range to traverse.
assert(extrema([5,2,9,4,1]) == [1, 9]);
See Implementation
Returns an array of the minimum and maximum element in r. Performs < 3n/2 comparisons, unlike the naive < 2n.