1. How would you need to change the method selectionSort so that it
can sort an array of values of type int into decreasing order, instead of
increasing order?
2. Consider an array b of int values in which a value occurs twice. For
example, suppose 7 occurs in both b[0] and b[5]. If you sort the array
using the method selectionSort, will the sorted array contain one or
two copies of the repeated value?
3. What output is produced by the following code?
int[][] testArray = new int[3][4];
for (int row = 0; row <>
for (int col = 0;
col <>
testArray[row][col] = col;
{
System.out.print(testArray[row][col] + " ");
System.out.println();
}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here