actually, also here std::nth_element
`std::nth_element (myvector.begin(), myvector.begin()+myvector.size()/4, myvector.end());`
would be correct. Note that nth_element will perform a partial sort and sort everything up to the nth element  and has O(N) complexity (not O(NlogN) like a sort algorithm).