I want to add a boolean value to this method so that if I used an already sorted array, no comparisons will be made.
int ncomp = 0; int nswaps = 0;