I\'m a programming student, and for a project I\'m working on, on of the things I have to do is compute the median value of a vector of int values. I\'m to do this using onl
There is no need to completely sort the vector: std::nth_element can do enough work to put the median in the correct position. See my answer to this question for an example.
Of course, that doesn't help if your teacher forbids using the right tool for the job.