Vector passed to the function

return type of the function void.
I passed vector but the sorted order was not reflected in the originally passed vector.

The same works well if i pass array to the function, the changes got reflected without the need to change the return type of the function.

Why didn’t the changes take place in vector as all the swapping were inplace ?

please share your code by saving it on ide.codingblocks.com