Fill in the code to complete the following method for sorting a list.
```
public static void sort(double[] list) {
___________________________;
}
public static void sort(double[] list, int high) {
if (high > 1) {
// Find the largest number and its index
int indexOfMax = 0;
double max = list[0];
for (int i = 1; i <= high; i++) {
if (list[i] > max) {
max = list[i];
indexOfMax = i;
}
}
// Swap the largest with the last number in the list
list[indexOfMax] = list[high];
list[high] = max;
// Sort the remaining list
sort(list, high - 1);
}
}```
a. sort(list)
b. sort(list, list.length)
c. sort(list, list.length - 1)
d. sort(list, list.length - 2)
c
You might also like to view...
The arrow operator (->) specifies
a. a member of a struct or class that is pointed to by a pointer variable b. the pointer member only of a struct or a class that is pointed to by a pointer variable c. less than or equal d. is known as NULL
What is the extension of the class header file?
What will be an ideal response?
Pointing to the Go to Slide button displays a list with the slide numbers and titles of each slide in the presentation
Indicate whether the statement is true or false
A USB keyboard or mouse can normally plug in to any available USB port
Indicate whether the statement is true or false