Consider tire following Java method f. Do not be concerned with f s purpose.
public static void f(int[] theArray, int n) {
int temp;
for (int j = 0; j < n; ++j) {
int i = 0;
while (i >= j) {
if (theArray[i] < (theArray[j])) {
temp = theArray[i];
theArray[i] = theArray[j];
theArray[j] = temp;
} // end if
++i;
} // end while
} // end for
} // end f
How many comparisons does f perform?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.