If you look here: How are arrays passed?
Arrays are passed as pointers already, and your implementation of std::swap (which you called “exchange”) is already passing by reference. So that is not an issue in your case. Has your professor complained about your program execution speed?
2
solved How can I make my program faster? [closed]