powered by
find.kth.element(x, k)
y <- rnorm(1e3) stopifnot(identical(y[order(y,decreasing=TRUE)[100]], find.kth.element(y,100)))
Run the code above in your browser using DataLab