powered by
Selects the k-th largest element of X + Y, a sum of sets. X + Y denotes the set \(\{x + y | x \in X, y \in Y\}\).
kthPair(x, y, k)
Numeric vector.
Index of element to be selected. Must be an integer and between 1 and the product of the lengths of x and y.
K-th largest value (numeric).
Johnson, D. B., & Mizoguchi, T. (1978). Selecting the K-th Element in X+Y and X_1+X_2+ ... +X_m. SIAM Journal on Computing, 7(2), 147-153.
# NOT RUN { x <- rnorm(100) y <- runif(100) kthPair(x, y, 5000) # }
Run the code above in your browser using DataLab