That's because you create a new vectors in
mergesort
.
In this function;
void mergesort(vector<int>& numbers)
you're not modifying the contents of
numbers
, you're creating two new vectors, copying the elements from
numbers
over to the new vectors.
This is why the result is the same as the input.
Hope this helps,
Fredrik