alternatively, since the greatest value ascends to the highest index within the first iteration and then has reached its final "right" position, two for-loops nested into one another sort the vector, too: