10
I don't want get a sorted array, just nth element's value. For example, given the array
a = [20, 5, 1, -3]
I'd like to be able to query
nth_element(a,2) = 1
In C++, there is a function std::nth_element that can do this. Is there an equivalent Java function?
Thanks!